1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00

🧹 Reformat code

This commit is contained in:
Steffo 2021-05-23 16:20:53 +02:00
parent 3dd139e78b
commit 7e8679a1e9
Signed by: steffo
GPG key ID: 6965406171929D01
25 changed files with 49 additions and 42 deletions

View file

@ -52,7 +52,7 @@ export default function BoxChart({ chartProps, ...props }) {
{...chartProps}
/>
),
[chartProps]
[chartProps],
)
return (

View file

@ -60,7 +60,7 @@ export default function BoxMap(
map.off("zoom", onMapZoom)
}
},
[map, mapViewHook]
[map, mapViewHook],
)
return (

View file

@ -26,7 +26,7 @@ export default function Button({ children, disabled, onClick, className, color,
disabled={disabled}
{...props}
>
{children} {makeIcon(icon, {className: Style.Icon})}
{children} {makeIcon(icon, { className: Style.Icon })}
</button>
)
}

View file

@ -31,7 +31,7 @@ export default function ButtonSidebar({ icon, children, to, className, ...props
return (
<Link to={to} className={Style.ButtonLink}>
<div className={classNames(Style.ButtonSidebar, "Clickable", className)} {...props}>
{makeIcon(icon, {className: Style.ButtonIcon})}
{makeIcon(icon, { className: Style.ButtonIcon })}
<div className={Style.ButtonText}>
{children}
</div>

View file

@ -22,7 +22,7 @@ export default function BoxConditionDatetime({ ...props }) {
const submit = useCallback(
timeRay => addCondition(new ConditionTime(timeRay)),
[addCondition]
[addCondition],
)
return (

View file

@ -22,7 +22,7 @@ export default function BoxConditionHashtag({ ...props }) {
const submit = useCallback(
value => addCondition(new ConditionHashtag(value)),
[addCondition]
[addCondition],
)
return (

View file

@ -24,7 +24,7 @@ export default function BoxConditionLocation({ ...props }) {
const onButtonClick = useCallback(
() => addCondition(new ConditionLocation(mapViewHook.mapArea)),
[mapViewHook, addCondition]
[mapViewHook, addCondition],
)
return (

View file

@ -5,7 +5,7 @@ import { faAt } from "@fortawesome/free-solid-svg-icons"
import useRepositoryEditor from "../../hooks/useRepositoryEditor"
import ContextLanguage from "../../contexts/ContextLanguage"
import FormInlineUser from "./FormInlineUser"
import { ConditionHashtag, ConditionUser } from "../../objects/Condition"
import { ConditionUser } from "../../objects/Condition"
/**
@ -22,7 +22,7 @@ export default function BoxConditionUser({ ...props }) {
const submit = useCallback(
value => addCondition(new ConditionUser(value)),
[addCondition]
[addCondition],
)
return (

View file

@ -41,7 +41,7 @@ export default function BoxFilterHasImage({ ...props }) {
{...props}
>
<FormInline>
<div style={{"flex-grow": 1}}>
<div style={{ "flex-grow": 1 }}>
{strings.hasImageExplaination}
</div>
<ButtonIconOnly

View file

@ -4,7 +4,7 @@ import FormInline from "../base/FormInline"
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
import useStrings from "../../hooks/useStrings"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { faLocationArrow, faMapMarkerAlt, faPlus } from "@fortawesome/free-solid-svg-icons"
import { faMapMarkerAlt, faPlus } from "@fortawesome/free-solid-svg-icons"
import { FilterWithPlace } from "../../objects/Filter"
import ButtonIconOnly from "../base/ButtonIconOnly"
@ -41,7 +41,7 @@ export default function BoxFilterHasPlace({ ...props }) {
{...props}
>
<FormInline>
<div style={{"flex-grow": 1}}>
<div style={{ "flex-grow": 1 }}>
{strings.hasPlaceExplaination}
</div>
<ButtonIconOnly

View file

@ -3,7 +3,7 @@ import BoxFull from "../base/BoxFull"
import useRepositoryViewer from "../../hooks/useRepositoryViewer"
import useStrings from "../../hooks/useStrings"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { faLocationArrow, faMapPin } from "@fortawesome/free-solid-svg-icons"
import { faLocationArrow } from "@fortawesome/free-solid-svg-icons"
import FormInlineLocation from "./FormInlineLocation"
import { FilterInsideMapArea } from "../../objects/Filter"

View file

@ -27,7 +27,7 @@ export default function BoxRepositoryTweets({ ...props }) {
return tweets.map(tweet => <SummaryTweet key={tweet["snowflake"]} tweet={tweet}/>)
}
},
[tweets]
[tweets],
)

View file

@ -35,10 +35,10 @@ export default function BoxVisualizationChart({ ...props }) {
data: hourlyTweetCount,
},
],
}
},
}
},
[tweets]
[tweets],
)
if(tweets.length === 0) {

View file

@ -20,7 +20,9 @@ export default function BoxVisualizationMap({ ...props }) {
const markers = useMemo(
() => {
return tweets.filter(tweet => tweet.location).map(tweet => {
if(!tweet.location) return null
if(!tweet.location) {
return null
}
const coords = Coordinates.fromCrawlerString(tweet.location)

View file

@ -23,7 +23,7 @@ export default function BoxVisualizationWordcloud({ ...props }) {
word => {
appendFilter(new FilterContains(word.text))
},
[appendFilter]
[appendFilter],
)
return (

View file

@ -34,7 +34,9 @@ export default function FormInlineText(
const _onSubmit = event => {
event.preventDefault()
if(!value) return
if(!value) {
return
}
submit(value)
setValue("")
}

View file

@ -40,7 +40,9 @@ export default function FormInlineTimeRay(
const _onSubmit = event => {
event.preventDefault()
if(!value) return
if(!value) {
return
}
console.debug(value)
submit(new TimeRay(isBefore, new Date(value)))
setValue("")

View file

@ -4,10 +4,10 @@ import {
faAt,
faClock,
faFont,
faHashtag, faImage,
faHashtag,
faImage,
faLocationArrow,
faMapMarkerAlt,
faMapPin,
} from "@fortawesome/free-solid-svg-icons"
import ButtonPicker from "./ButtonPicker"
import ContextRepositoryViewer from "../../contexts/ContextRepositoryViewer"

View file

@ -35,10 +35,10 @@ export default function GlobalLanguage({ children }) {
return <i className={Style.MissingString} title={name}>MISSING STRING</i>
}
},
[lang]
[lang],
)
const strings = new Proxy({}, {get: getString})
const strings = new Proxy({}, { get: getString })
return (

View file

@ -1,10 +1,10 @@
import {
IconDefinition,
faQuestionCircle,
faHashtag,
faAt,
faClock,
faHashtag,
faLocationArrow,
faQuestionCircle,
IconDefinition,
} from "@fortawesome/free-solid-svg-icons"

View file

@ -3,10 +3,10 @@ import {
faClock,
faFilter,
faFont,
faHashtag, faImage,
faHashtag,
faImage,
faLocationArrow,
faMapMarkerAlt,
faMapPin,
} from "@fortawesome/free-solid-svg-icons"
@ -47,7 +47,7 @@ export class Filter {
return {
color: "Grey",
icon: faFilter,
children: this.negate ? "False" : "True"
children: this.negate ? "False" : "True",
}
}
}
@ -72,7 +72,7 @@ export class FilterContains extends Filter {
return {
color: "Grey",
icon: faFont,
children: this.string
children: this.string,
}
}
}
@ -93,7 +93,7 @@ export class FilterHashtag extends FilterContains {
return {
color: "Grey",
icon: faHashtag,
children: this.hashtag
children: this.hashtag,
}
}
}
@ -118,7 +118,7 @@ export class FilterPoster extends Filter {
return {
color: "Green",
icon: faAt,
children: this.poster
children: this.poster,
}
}
}
@ -140,7 +140,7 @@ export class FilterWithLocation extends Filter {
return {
color: "Red",
icon: faLocationArrow,
children: ""
children: "",
}
}
}
@ -162,7 +162,7 @@ export class FilterWithPlace extends Filter {
return {
color: "Red",
icon: faMapMarkerAlt,
children: ""
children: "",
}
}
}
@ -191,7 +191,7 @@ export class FilterInsideMapArea extends FilterWithLocation {
return {
color: "Red",
icon: faLocationArrow,
children: this.mapArea.toHumanString()
children: this.mapArea.toHumanString(),
}
}
}
@ -216,7 +216,7 @@ export class FilterInsideTimeRay extends Filter {
return {
color: "Yellow",
icon: faClock,
children: this.timeRay.toString()
children: this.timeRay.toString(),
}
}
}
@ -238,7 +238,7 @@ export class FilterWithImage extends Filter {
return {
color: "Grey",
icon: faImage,
children: ""
children: "",
}
}
}

View file

@ -1,4 +1,4 @@
import {getDistance} from "geolib"
import { getDistance } from "geolib"
import osmZoomLevels from "../utils/osmZoomLevels"

View file

@ -23,6 +23,8 @@ export default class TimeRay {
}
includes(date) {
return Boolean((this.date > date) ^ this.isBefore)
return Boolean((
this.date > date
) ^ this.isBefore)
}
}

View file

@ -1,7 +1,6 @@
import React, { useContext } from "react"
import Style from "./PageSettings.module.css"
import classNames from "classnames"
import BoxHeader from "../components/base/BoxHeader"
import BoxFull from "../components/base/BoxFull"
import SelectTheme from "../components/interactive/SelectTheme"
import BoxLoggedIn from "../components/interactive/BoxLoggedIn"

View file

@ -1,6 +1,6 @@
import React, { isValidElement } from "react"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import {IconDefinition} from "@fortawesome/fontawesome-svg-core"
import { IconDefinition } from "@fortawesome/fontawesome-svg-core"
/**