Skip to content

Commit

Permalink
feat: style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmv committed Nov 29, 2024
1 parent dba3800 commit 5d1f81d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@ import { IconChevronUp16, IconChevronDown16, colors, spacers } from '@dhis2/ui';

type Props = $ReadOnly<{|
coordinates: Array<Array<number>>,
classes: { viewButton: string },
classes: {
buttonContainer: string,
viewButton: string,
},
|}>;

const styles = {
buttonContainer: {
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
},
viewButton: {
background: 'none',
border: 'none',
Expand All @@ -32,14 +40,17 @@ const PolygonCoordinatesPlain = ({ coordinates, classes }: Props) => {
{coordinates.slice(0, showMore ? coordinates.length : 1).map((coordinatePair, index) => (
// eslint-disable-next-line react/no-array-index-key
<div key={index}>
{`lat: ${coordinatePair[1]} long: ${coordinatePair[0]}`}
{`lat: ${coordinatePair[1]}`}<br />
{`long: ${coordinatePair[0]}`}
</div>
))}
</div>
<button className={classes.viewButton} onClick={() => setShowMore(!showMore)}>
{showMore ? 'Show Less' : 'Show More'}
{showMore ? <IconChevronUp16 /> : <IconChevronDown16 />}
</button>
<div className={classes.buttonContainer}>
<button className={classes.viewButton} onClick={() => setShowMore(!showMore)}>
{showMore ? 'Show Less' : 'Show More'}
{showMore ? <IconChevronUp16 /> : <IconChevronDown16 />}
</button>
</div>
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const styles = {
wordBreak: 'break-word',
maxWidth: '82%',
},
updateArrow: {
arrow: {
margin: spacers.dp4,
},
};
Expand Down

0 comments on commit 5d1f81d

Please sign in to comment.