Skip to content

Commit

Permalink
frontend: use 1x1 flags for ch, np and va
Browse files Browse the repository at this point in the history
Some flags have a square format (1:1 ratio).
  • Loading branch information
thisconnect committed Mar 16, 2023
1 parent 6abb5f3 commit ca193b8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions frontends/web/node_vendor/flag-icons/css/flag-icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
.fi:before {
content: '\00a0';
}
/* squareflags should occupy same space as 4x3 flags
.fi.fis {
width: 1em;
}
*/
.fi-xx {
background-image: url(../flags/4x3/xx.svg);
}
Expand Down
12 changes: 9 additions & 3 deletions frontends/web/src/routes/buy/components/countryselect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ type TProps = {
}

const SelectedRegionIcon = ({ regionCode }: { regionCode: string }) => {
return <span>
{regionCode === '' ? <Globe className={styles.globe} /> : <span className={`fi fi-${regionCode} ${styles.flag}`}></span>}
</span>;
const squareFlag = ['ch', 'np', 'va'].includes(regionCode) ? 'fis' : '';
return (
<span>
{ regionCode === ''
? (<Globe className={styles.globe} />)
: (<span className={`fi fi-${regionCode} ${styles.flag} ${squareFlag}`}></span>)
}
</span>
);
};

const SelectSingleValue: FunctionComponent<SingleValueProps<TOption>> = (props) => {
Expand Down

0 comments on commit ca193b8

Please sign in to comment.