-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d2645b
commit 345778d
Showing
10 changed files
with
130 additions
and
160 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
97 changes: 0 additions & 97 deletions
97
frontend/components/LinePatternPathStop/LinePatternPathStop.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
frontend/components/LinesExplorerContentPatternPath/LinesExplorerContentPatternPath.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use client'; | ||
|
||
/* * */ | ||
|
||
import styles from './LinesExplorerContentPatternPath.module.css'; | ||
import LinePatternPathStop from '@/components/LinesExplorerContentPatternPathStop/LinesExplorerContentPatternPathStop'; | ||
import { useLinesExplorerContext } from '@/contexts/LinesExplorerContext'; | ||
|
||
/* * */ | ||
|
||
export default function LinesExplorerContentPatternPath() { | ||
// | ||
|
||
// | ||
// A. Setup variables | ||
|
||
const linesExplorerContext = useLinesExplorerContext(); | ||
|
||
// | ||
// B. Render components | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<div>{linesExplorerContext.entities.pattern.id}</div> | ||
{linesExplorerContext.entities.pattern.path?.map((pathStop, pathIndex) => ( | ||
<div key={pathIndex}> | ||
<LinePatternPathStop pathStopData={pathStop} /> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
|
||
// | ||
} |
File renamed without changes.
85 changes: 85 additions & 0 deletions
85
...end/components/LinesExplorerContentPatternPathStop/LinesExplorerContentPatternPathStop.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
'use client'; | ||
|
||
/* * */ | ||
|
||
import useSWR from 'swr'; | ||
import { useTranslations } from 'next-intl'; | ||
import { useLineFormContext } from '@/forms/LineForm'; | ||
import styles from './LinesExplorerContentPatternPathStop.module.css'; | ||
import CopyBadge from '../CopyBadge/CopyBadge'; | ||
import LinePatternPathSpine from '../LinePatternPathSpine/LinePatternPathSpine'; | ||
import LinePatternPathTimetable from '../LinePatternPathTimetable/LinePatternPathTimetable'; | ||
import { useMemo, useState } from 'react'; | ||
import StopName from '../StopName/StopName'; | ||
import { Space } from '@mantine/core'; | ||
import StopPDF from '../StopPDF/StopPDF'; | ||
import StopRealTime from '../StopRealTime/StopRealTime'; | ||
import LiveIcon from '../LiveIcon/LiveIcon'; | ||
import Text from '../Text/Text'; | ||
import { useLinesExplorerContext } from '@/contexts/LinesExplorerContext'; | ||
|
||
/* * */ | ||
|
||
export default function LinesExplorerContentPatternPathStop({ pathStopData }) { | ||
// | ||
|
||
// | ||
// A. Setup variables | ||
|
||
const t = useTranslations('LinesExplorerContentPatternPathStop'); | ||
const linesExplorerContext = useLinesExplorerContext(); | ||
const [isThisStopSelected, setIsThisStopSelected] = useState(false); | ||
|
||
// | ||
// B. Handle actions | ||
|
||
const handleStopClick = () => { | ||
setIsThisStopSelected((prev) => !prev); | ||
}; | ||
|
||
// | ||
// C. Render components | ||
|
||
return ( | ||
<div className={`${styles.container} ${isThisStopSelected && styles.selected}`} onClick={handleStopClick}> | ||
<div className={styles.travelTime}></div> | ||
|
||
{/* <LinePatternPathSpine style={pathStopData.stop_sequence === 0 ? 'start' : 'regular'} color={linesExplorerContext.entities.pattern.color} text_color={linesExplorerContext.entities.pattern.text_color} isSelected={isThisStopSelected} /> */} | ||
|
||
<div className={styles.info}> | ||
<div className={styles.header}> | ||
<div>{pathStopData.stop.id}</div> | ||
<StopName id={pathStopData.stop.id} name={pathStopData.stop.name} tts_name={pathStopData.stop.tts_name} locality={pathStopData.stop.localiy} municipality={pathStopData.stop.municipality} /> | ||
{!isThisStopSelected && <StopRealTime pattern_code={linesExplorerContext.entities.pattern.id} stop_code={pathStopData.stop.id} />} | ||
</div> | ||
|
||
{isThisStopSelected && ( | ||
<div className={styles.body}> | ||
<Text type="mini-label">Próximas circulações</Text> | ||
<StopRealTime pattern_id={linesExplorerContext.entities.pattern.id} stop_id={pathStopData.stop.id} /> | ||
</div> | ||
)} | ||
|
||
{isThisStopSelected && ( | ||
<div className={styles.body}> | ||
<Text type="mini-label">Horários previstos nesta paragem</Text> | ||
<LinePatternPathTimetable index={pathStopData.stop_sequence} stopId={pathStopData.stop.id} /> | ||
</div> | ||
)} | ||
|
||
{/* {isThisStopSelected && <StopPDF line_code={lineForm.values.line_code} stop_code={stop_code} direction={linesExplorerContext.entities.pattern.direction} />} */} | ||
{/* {isThisStopSelected && ( | ||
<div className={styles.body}> | ||
<div className={styles.ids}> | ||
<CopyBadge label={`#${pathStopData.stop.id}`} value={pathStopData.stop.id} /> | ||
<CopyBadge label={`${pathStopData.stop.latitude}, ${pathStopData.stop.longitude}`} value={`${pathStopData.stop.latitude} ${pathStopData.stop.longitude}`} /> | ||
</div> | ||
<LinePatternPathTimetable index={index} stop_code={stop_code} /> | ||
</div> | ||
)} */} | ||
</div> | ||
</div> | ||
); | ||
|
||
// | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters