-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2208 from protofire/feature/proposal-details-2190
Proposal Details
- Loading branch information
Showing
18 changed files
with
576 additions
and
39 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
import { TYPE } from '../../../../theme' | ||
import { CardCSS } from '../index' | ||
|
||
const CardStyled = styled.div` | ||
${CardCSS}; | ||
box-shadow: none; | ||
width: fit-content; | ||
display: flex; | ||
flex-direction: row; | ||
gap: 48px; | ||
padding: 24px 32px; | ||
justify-content: space-between; | ||
//mobile | ||
@media (max-width: ${props => props.theme.themeBreakPoints.xl}) { | ||
flex-direction: column; | ||
width: 100%; | ||
gap: 10px; | ||
padding: 20px; | ||
} | ||
` | ||
const ItemWrapper = styled.div` | ||
> div:nth-child(2) { | ||
margin-top: 8px; | ||
@media (max-width: ${props => props.theme.themeBreakPoints.xl}) { | ||
margin-top: 0px; | ||
} | ||
} | ||
@media (max-width: ${props => props.theme.themeBreakPoints.xl}) { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
` | ||
const DataWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
` | ||
|
||
interface Props { | ||
valueObject: any | ||
} | ||
export const Table: React.FC<Props> = (props: Props) => { | ||
const { valueObject, ...restProps } = props | ||
|
||
return ( | ||
<CardStyled {...restProps}> | ||
{valueObject.map((item: any) => { | ||
return ( | ||
<ItemWrapper key={item}> | ||
<TYPE.bodyRegular color={'text2'}>{item[0]}</TYPE.bodyRegular> | ||
<DataWrapper> | ||
<TYPE.bodyMedium color={'text1'}>{item[1].text} </TYPE.bodyMedium> | ||
{item[1]['icon'] !== undefined && <div style={{ marginLeft: '8px' }}> {item[1].icon}</div>} | ||
</DataWrapper> | ||
</ItemWrapper> | ||
) | ||
})} | ||
</CardStyled> | ||
) | ||
} |
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
71 changes: 71 additions & 0 deletions
71
app/src/components/common/table/responsive_table_simple/index.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,71 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
import { TYPE } from '../../../../theme' | ||
|
||
const Table = styled.div` | ||
width: 100%; | ||
grid-template-columns: 1fr 1fr; | ||
border: ${props => props.theme.borders.borderLineDisabled}; | ||
border-radius: 6px; | ||
display: grid; | ||
@media (max-width: ${props => props.theme.themeBreakPoints.xl}) { | ||
grid-template-columns: 1fr; | ||
} | ||
` | ||
const TableData = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 10px 16px; | ||
text-align: center; | ||
margin: 0 -1px -1px 0; | ||
@media (max-width: ${props => props.theme.themeBreakPoints.xl}) { | ||
:not(:last-child) { | ||
border-bottom: ${props => props.theme.borders.borderLineDisabled}; | ||
} | ||
} | ||
@media (min-width: ${props => props.theme.themeBreakPoints.xl}) { | ||
&:nth-child(odd) { | ||
border-width: 0px 1px 1px 0; /* top right bottom left */ | ||
border-style: solid; | ||
border-color: ${props => props.theme.colors.verticalDivider}; | ||
} | ||
&:nth-child(even) { | ||
border-width: 0 0 1px 1px; /* top right bottom left */ | ||
border-style: solid; | ||
border-color: ${props => props.theme.colors.verticalDivider}; | ||
} | ||
:last-child, | ||
:nth-last-child(2):nth-child(odd) { | ||
border-bottom: none; | ||
} | ||
} | ||
` | ||
|
||
const TextData = styled(TYPE.bodyRegular)` | ||
color: ${props => props.theme.text2}; | ||
` | ||
|
||
interface Props { | ||
outcomes: (string | number)[][] | ||
} | ||
|
||
export const ResponsiveTableSimple = (props: Props) => { | ||
const { outcomes } = props | ||
|
||
return ( | ||
<Table> | ||
{outcomes.map((item: any) => { | ||
return ( | ||
<TableData key={item}> | ||
<TextData>{item[0]}</TextData> | ||
<TextData>{item[1]}</TextData> | ||
</TableData> | ||
) | ||
})} | ||
</Table> | ||
) | ||
} |
Oops, something went wrong.