-
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.
feat: show added and removed communities in history
- Loading branch information
Showing
16 changed files
with
350 additions
and
99 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
app/components/Analyst/CBC/History/CbcHistoryCommunitiesTable.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,81 @@ | ||
import styled from 'styled-components'; | ||
|
||
interface Props { | ||
action: string; | ||
communities: any[]; | ||
} | ||
|
||
const StyledCommunitiesContainer = styled.div` | ||
display: flex; | ||
align-items: center; | ||
`; | ||
|
||
const StyledLeftContainer = styled.div` | ||
padding-right: 2%; | ||
width: 250px; | ||
`; | ||
|
||
const StyledTable = styled.table` | ||
th { | ||
border: none; | ||
} | ||
tbody > tr { | ||
border-bottom: thin dashed; | ||
border-color: ${(props) => props.theme.color.borderGrey}; | ||
td { | ||
width: 200px; | ||
max-width: 200px; | ||
border: none; | ||
} | ||
} | ||
`; | ||
|
||
const StyledIdCell = styled.td` | ||
width: 100px !important; | ||
max-width: 100px; | ||
`; | ||
|
||
const CbcHistoryCommunitiesTable: React.FC<Props> = ({ | ||
action, | ||
communities, | ||
}) => { | ||
return ( | ||
<StyledCommunitiesContainer | ||
style={{ display: 'flex', alignItems: 'center' }} | ||
> | ||
<StyledLeftContainer>{`${action} community location data`}</StyledLeftContainer> | ||
<div> | ||
<StyledTable> | ||
<thead> | ||
<tr> | ||
<th>Economic Region</th> | ||
<th>Regional District</th> | ||
<th>Geographic Name</th> | ||
<th>Type</th> | ||
<th>ID</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{communities?.map((community, index) => ( | ||
<tr | ||
// eslint-disable-next-line react/no-array-index-key | ||
key={`${action}-${community.communities_source_data_id}-${index}`} | ||
data-key={`${action}-row-${index}`} | ||
> | ||
<td>{community.economic_region}</td> | ||
<td>{community.regional_district}</td> | ||
<td>{community.bc_geographic_name}</td> | ||
<td>{community.geographic_type}</td> | ||
<StyledIdCell> | ||
{community.communities_source_data_id} | ||
</StyledIdCell> | ||
</tr> | ||
))} | ||
</tbody> | ||
</StyledTable> | ||
</div> | ||
</StyledCommunitiesContainer> | ||
); | ||
}; | ||
|
||
export default CbcHistoryCommunitiesTable; |
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
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
Oops, something went wrong.