Skip to content

Commit

Permalink
feat(board): removed use of thirdparty colors
Browse files Browse the repository at this point in the history
  • Loading branch information
vildeopp committed Jul 14, 2023
1 parent 1437f60 commit aac7c57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 5 additions & 8 deletions next-tavla/src/Board/scenarios/Table/components/Line/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { useNonNullContext } from 'hooks/useNonNullContext'
import { getPresentation } from 'Board/utils/colors'
import { DepartureContext } from '../../contexts'
import classes from './styles.module.css'

function Line() {
const departure = useNonNullContext(DepartureContext)

const presentation = getPresentation(
departure.serviceJourney.line.presentation,
departure.serviceJourney.line.id,
departure.serviceJourney.transportMode,
)
const mode = departure.serviceJourney.transportMode
? departure.serviceJourney.transportMode
: 'unknown'
const defaultColor = `var(--table-transport-${mode}-color)`

const publicCode = departure.serviceJourney.line.publicCode

Expand All @@ -19,8 +17,7 @@ function Line() {
<div
className={classes.lineWrapper}
style={{
backgroundColor: presentation.backgroundColor,
color: presentation.color,
backgroundColor: defaultColor,
}}
>
{publicCode}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
padding: 0.25em;
border-radius: 0.2em;
font-size: 0.9em;
font-weight: 500;
font-weight: 700;
color: var(--main-background-color);
}

0 comments on commit aac7c57

Please sign in to comment.