File tree Expand file tree Collapse file tree 11 files changed +33
-17
lines changed
domain/RiskImminentEvents Expand file tree Collapse file tree 11 files changed +33
-17
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import styles from './styles.module.css';
2121export interface Props {
2222 className ?: string ;
2323 popupClassName ?: string ;
24+ preferredPopupWidth ?: number ;
2425 children ?: React . ReactNode ;
2526 label ?: React . ReactNode ;
2627 activeClassName ?: string ;
@@ -50,6 +51,7 @@ function DropdownMenu(props: Props) {
5051 componentRef,
5152 elementRef : buttonRef = newButtonRef ,
5253 persistent,
54+ preferredPopupWidth,
5355 } = props ;
5456
5557 const dropdownRef = useRef < HTMLDivElement > ( null ) ;
@@ -135,6 +137,7 @@ function DropdownMenu(props: Props) {
135137 elementRef = { dropdownRef }
136138 className = { _cs ( styles . dropdownContent , popupClassName ) }
137139 parentRef = { buttonRef }
140+ preferredWidth = { preferredPopupWidth }
138141 >
139142 { children }
140143 </ Popup >
Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ function CountryDropdown() {
102102 variant = "tertiary"
103103 popupClassName = { styles . dropdown }
104104 persistent
105+ preferredPopupWidth = { 56 }
105106 >
106107 { isEmpty && (
107108 < Message
@@ -176,6 +177,7 @@ function CountryDropdown() {
176177 urlParams = { { countryId : id } }
177178 variant = "tertiary"
178179 withLinkIcon
180+ className = { styles . countryLink }
179181 >
180182 { name }
181183 </ DropdownMenuItem >
Original file line number Diff line number Diff line change 22 display : flex;
33 flex-direction : row;
44 padding : var (--go-ui-spacing-md );
5- width : calc (100% - var (--go-ui-spacing-md ) * 2 )!important ;
65 max-width : 64rem ;
76 min-height : 16rem ;
87 gap : var (--go-ui-spacing-md );
3736 grid-template-columns : repeat (auto-fit, minmax (12rem , 1fr ));
3837 grid-gap : var (--go-ui-spacing-sm );
3938 overflow : auto;
39+
40+ .country-link {
41+ font-size : var (--go-ui-font-size-sm );
42+ }
4043 }
4144 }
4245 }
Original file line number Diff line number Diff line change @@ -19,9 +19,9 @@ import TabPanel from '#components/Tabs/TabPanel';
1919
2020import AuthenticatedUserDropdown from './AuthenticatedUserDropdown' ;
2121import LangaugeDropdown from './LanguageDropdown' ;
22+ import CountryDropdown from './CountryDropdown' ;
2223import i18n from './i18n.json' ;
2324import styles from './styles.module.css' ;
24- import CountryDropdown from './CountryDropdown' ;
2525
2626interface Props {
2727 className ?: string ;
@@ -135,6 +135,7 @@ function Navbar(props: Props) {
135135 label = { strings . userMenuPrepare }
136136 variant = "tertiary"
137137 persistent
138+ preferredPopupWidth = { 56 }
138139 >
139140 < Tabs
140141 value = { activePrepareOption }
@@ -252,6 +253,7 @@ function Navbar(props: Props) {
252253 label = { strings . userMenuRespondLabel }
253254 variant = "tertiary"
254255 persistent
256+ preferredPopupWidth = { 56 }
255257 >
256258 < Tabs
257259 value = { activeRespondOption }
@@ -398,6 +400,7 @@ function Navbar(props: Props) {
398400 label = { strings . userMenuLearnLabel }
399401 variant = "tertiary"
400402 persistent
403+ preferredPopupWidth = { 56 }
401404 >
402405 < Tabs
403406 value = { activeLearnOption }
Original file line number Diff line number Diff line change 22 display : flex;
33 flex-direction : row;
44 padding : var (--go-ui-spacing-md );
5- width : calc (100% - var (--go-ui-spacing-md ) * 2 )!important ;
65 max-width : 32rem ;
76 min-height : 16rem ;
87 gap : var (--go-ui-spacing-md );
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ interface Props {
1111 elementRef ?: React . RefObject < HTMLDivElement > ;
1212 parentRef : React . RefObject < HTMLElement | undefined > ;
1313 children ?: React . ReactNode ;
14+ preferredWidth ?: number ;
1415}
1516
1617function Popup ( props : Props ) {
@@ -20,14 +21,15 @@ function Popup(props: Props) {
2021 children,
2122 className,
2223 pointerClassName,
24+ preferredWidth,
2325 } = props ;
2426
2527 const {
2628 content,
2729 pointer,
2830 width,
2931 orientation,
30- } = useFloatPlacement ( parentRef ) ;
32+ } = useFloatPlacement ( parentRef , preferredWidth ) ;
3133
3234 return (
3335 < Portal >
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ function EventListItem(props: Props) {
3232 return (
3333 < Header
3434 className = { styles . eventListItem }
35- heading = { hazard_name }
35+ heading = { hazard_name ?? '--' }
3636 headingLevel = { 5 }
3737 actions = { (
3838 < Button
@@ -44,7 +44,7 @@ function EventListItem(props: Props) {
4444 < ChevronRightLineIcon className = { styles . icon } />
4545 </ Button >
4646 ) }
47- spacing = "compact "
47+ spacing = "condensed "
4848 >
4949 < TextOutput
5050 label = { strings . gdacsEventStartedOn }
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ function EventListItem(props: Props) {
3636 return (
3737 < Header
3838 className = { styles . eventListItem }
39- heading = { hazardName }
39+ heading = { hazardName ?? '--' }
4040 headingLevel = { 5 }
4141 actions = { (
4242 < Button
@@ -48,7 +48,7 @@ function EventListItem(props: Props) {
4848 < ChevronRightLineIcon className = { styles . icon } />
4949 </ Button >
5050 ) }
51- spacing = "compact "
51+ spacing = "condensed "
5252 >
5353 < TextOutput
5454 label = { strings . meteoSwissEventListStartedOn }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ function EventListItem(props: Props) {
3232 return (
3333 < Header
3434 className = { styles . eventListItem }
35- heading = { hazard_name }
35+ heading = { hazard_name ?? '--' }
3636 headingLevel = { 5 }
3737 actions = { (
3838 < Button
@@ -44,6 +44,7 @@ function EventListItem(props: Props) {
4444 < ChevronRightLineIcon className = { styles . icon } />
4545 </ Button >
4646 ) }
47+ spacing = "condensed"
4748 >
4849 < TextOutput
4950 label = { strings . eventListStartedOn }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ function EventListItem(props: Props) {
3232 return (
3333 < Header
3434 className = { styles . eventListItem }
35- heading = { title }
35+ heading = { title ?? '--' }
3636 headingLevel = { 5 }
3737 actions = { (
3838 < Button
@@ -44,7 +44,7 @@ function EventListItem(props: Props) {
4444 < ChevronRightLineIcon className = { styles . icon } />
4545 </ Button >
4646 ) }
47- spacing = "compact "
47+ spacing = "condensed "
4848 >
4949 < TextOutput
5050 label = { strings . wfpEventListPublishedOn }
You can’t perform that action at this time.
0 commit comments