-
Notifications
You must be signed in to change notification settings - Fork 1
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
7e27f09
commit 807ffcc
Showing
9 changed files
with
71 additions
and
62 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/features/Results/CaseResult/CaseResultCard/CaseResultCard.styled.tsx
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,19 @@ | ||
import styled from 'styled-components'; | ||
import { spacings } from '../../../../tokens/spacings'; | ||
import { theme } from '../../../../tokens/theme'; | ||
|
||
export const CaseResultCard = styled.div` | ||
display: flex; | ||
flex-direction: row; | ||
width: 60%; | ||
column-gap: ${spacings.LARGE}; | ||
padding-left: ${spacings.LARGE}; | ||
background-color: ${theme.light.ui.background.light}; | ||
&:hover { | ||
background-color: ${theme.light.ui.background.medium}; | ||
cursor: pointer; | ||
} | ||
`; |
17 changes: 17 additions & 0 deletions
17
src/features/Results/CaseResult/CaseResultCard/CaseResultCard.tsx
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,17 @@ | ||
import { useNavigate } from 'react-router-dom'; | ||
import { ResultType } from '../../../../pages/ModelPages/Results/Results'; | ||
import * as Styled from './CaseResultCard.styled'; | ||
|
||
export const CaseResultCard = ({ result }: { result: ResultType }) => { | ||
const navigate = useNavigate(); | ||
const handleClick = () => { | ||
navigate(`${result.id}`); | ||
}; | ||
|
||
return ( | ||
<Styled.CaseResultCard onClick={handleClick}> | ||
<h2>{result.case}</h2> | ||
{result.finished ? <h4>Finished</h4> : <h4>Not computed yet!</h4>} | ||
</Styled.CaseResultCard> | ||
); | ||
}; |
12 changes: 12 additions & 0 deletions
12
src/features/Results/CaseResult/CaseResultList/CaseResultList.styled.tsx
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,12 @@ | ||
import styled from 'styled-components'; | ||
import { spacings } from '../../../../tokens/spacings'; | ||
|
||
export const CaseResultList = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
column-gap: ${spacings.LARGE}; | ||
row-gap: ${spacings.LARGE}; | ||
margin: ${spacings.XXX_LARGE}; | ||
`; |
13 changes: 13 additions & 0 deletions
13
src/features/Results/CaseResult/CaseResultList/CaseResultList.tsx
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,13 @@ | ||
import { ResultType } from '../../../../pages/ModelPages/Results/Results'; | ||
import { CaseResultCard } from '../../CaseResult/CaseResultCard/CaseResultCard'; | ||
import * as Styled from './CaseResultList.styled'; | ||
|
||
export const CaseResultList = ({ results }: { results: ResultType[] }) => { | ||
return ( | ||
<Styled.CaseResultList> | ||
{results.map((res: ResultType) => ( | ||
<CaseResultCard key={res.id} result={res} /> | ||
))} | ||
</Styled.CaseResultList> | ||
); | ||
}; |
4 changes: 2 additions & 2 deletions
4
...Results/CaseResult/CaseResults.styled.tsx → .../CaseResultView/CaseResultView.styled.tsx
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
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