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] [chartProps],
) )
return ( return (

View file

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

View file

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

View file

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

View file

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

View file

@ -5,7 +5,7 @@ import { faAt } from "@fortawesome/free-solid-svg-icons"
import useRepositoryEditor from "../../hooks/useRepositoryEditor" import useRepositoryEditor from "../../hooks/useRepositoryEditor"
import ContextLanguage from "../../contexts/ContextLanguage" import ContextLanguage from "../../contexts/ContextLanguage"
import FormInlineUser from "./FormInlineUser" 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( const submit = useCallback(
value => addCondition(new ConditionUser(value)), value => addCondition(new ConditionUser(value)),
[addCondition] [addCondition],
) )
return ( return (

View file

@ -4,7 +4,7 @@ import FormInline from "../base/FormInline"
import useRepositoryViewer from "../../hooks/useRepositoryViewer" import useRepositoryViewer from "../../hooks/useRepositoryViewer"
import useStrings from "../../hooks/useStrings" import useStrings from "../../hooks/useStrings"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" 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 { FilterWithPlace } from "../../objects/Filter"
import ButtonIconOnly from "../base/ButtonIconOnly" import ButtonIconOnly from "../base/ButtonIconOnly"

View file

@ -3,7 +3,7 @@ import BoxFull from "../base/BoxFull"
import useRepositoryViewer from "../../hooks/useRepositoryViewer" import useRepositoryViewer from "../../hooks/useRepositoryViewer"
import useStrings from "../../hooks/useStrings" import useStrings from "../../hooks/useStrings"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" 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 FormInlineLocation from "./FormInlineLocation"
import { FilterInsideMapArea } from "../../objects/Filter" 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}/>) 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, data: hourlyTweetCount,
}, },
], ],
} },
} }
}, },
[tweets] [tweets],
) )
if(tweets.length === 0) { if(tweets.length === 0) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -23,6 +23,8 @@ export default class TimeRay {
} }
includes(date) { 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 React, { useContext } from "react"
import Style from "./PageSettings.module.css" import Style from "./PageSettings.module.css"
import classNames from "classnames" import classNames from "classnames"
import BoxHeader from "../components/base/BoxHeader"
import BoxFull from "../components/base/BoxFull" import BoxFull from "../components/base/BoxFull"
import SelectTheme from "../components/interactive/SelectTheme" import SelectTheme from "../components/interactive/SelectTheme"
import BoxLoggedIn from "../components/interactive/BoxLoggedIn" import BoxLoggedIn from "../components/interactive/BoxLoggedIn"