Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 30 additions & 26 deletions app/src/components/Navbar/CountryDropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,37 +152,41 @@ function CountryDropdown() {
className={styles.regionDetailContent}
withHeaderBorder
withContentOverflow
heading={(
<DropdownMenuItem
type="link"
to="regionsLayout"
urlParams={{ regionId: region.key }}
withLinkIcon
colorVariant="primary"
styleVariant="filled"
withoutFullWidth
spacing="sm"
headerDescription={(
<ListView
withWrap
withSpaceBetweenContents
>
{/* FIXME: use translation */}
{`${region.value} Region`}
</DropdownMenuItem>
)}
headingLevel={4}
headerActions={(
<TextInput
name={undefined}
placeholder={strings.countryDropdownSearchPlaceholder}
value={countrySearch}
onChange={setCountrySearch}
icons={<SearchLineIcon />}
/>
<DropdownMenuItem
type="link"
to="regionsLayout"
urlParams={{ regionId: region.key }}
withLinkIcon
colorVariant="primary"
styleVariant="filled"
withoutFullWidth
spacing="sm"
>
{/* FIXME: use translation */}
{`${region.value} Region`}
</DropdownMenuItem>
<TextInput
name={undefined}
placeholder={strings
.countryDropdownSearchPlaceholder}
value={countrySearch}
onChange={setCountrySearch}
icons={<SearchLineIcon />}
/>
</ListView>
)}
withPadding
>
<ListView
layout="grid"
spacing="sm"
numPreferredGridColumns={3}
spacing="xs"
numPreferredGridColumns={4}
minGridColumnSize="10rem"
>
{/* TODO: use RawList */}
{countriesInSelectedRegion?.map(
Expand All @@ -193,10 +197,10 @@ function CountryDropdown() {
to="countriesLayout"
urlParams={{ countryId: id }}
styleVariant="action"
withLinkIcon
spacing="sm"
withoutFullWidth
withoutPadding
textSize="sm"
>
{name}
</DropdownMenuItem>
Expand Down
3 changes: 2 additions & 1 deletion app/src/components/Navbar/CountryDropdown/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
flex-direction: row;
max-width: 64rem;
min-height: 16rem;
max-height: 70vh;
overflow: auto;

.region-list {
flex-basis: 10rem;
flex-basis: 9rem;
flex-shrink: 0;
padding: var(--go-ui-spacing-md) 0 0 var(--go-ui-spacing-md);
}
Expand Down
133 changes: 70 additions & 63 deletions app/src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,72 +61,79 @@ function Navbar(props: Props) {
className={styles.top}
contentClassName={styles.topContent}
>
<div className={styles.brand}>
<Link to="home">
<img
className={styles.goIcon}
src={goLogo}
alt={strings.headerLogoAltText}
/>
</Link>
{environment !== 'production' && (
<div className={styles.env}>
{environment}
</div>
)}
</div>
<NavigationTabList styleVariant="nav">
<LanguageDropdown />
{!isAuthenticated && (
<>
<NavigationTab
to="login"
className={styles.actionItem}
<ListView
withWrap
withSpaceBetweenContents
>
<div className={styles.brand}>
<Link to="home">
<img
className={styles.goIcon}
src={goLogo}
alt={strings.headerLogoAltText}
/>
</Link>
{environment !== 'production' && (
<div className={styles.env}>
{environment}
</div>
)}
</div>
<NavigationTabList styleVariant="nav">
<LanguageDropdown />
{!isAuthenticated && (
<>
<NavigationTab
to="login"
className={styles.actionItem}
>
{strings.userMenuLogin}
</NavigationTab>
<NavigationTab
to="register"
className={styles.actionItem}
>
{strings.userMenuRegister}
</NavigationTab>
</>
)}
<AuthenticatedUserDropdown />
<DropdownMenu
label={strings.headerCreateAReportLabel}
labelColorVariant="primary"
labelSpacing="lg"
>
<DropdownMenuItem
type="link"
to="fieldReportFormNew"
>
{strings.userMenuLogin}
</NavigationTab>
<NavigationTab
to="register"
className={styles.actionItem}
{strings.headerDropdownNewFieldReport}
</DropdownMenuItem>
<DropdownMenuItem
type="link"
to="newThreeWActivity"
>
{strings.userMenuRegister}
</NavigationTab>
</>
)}
<AuthenticatedUserDropdown />
<DropdownMenu
label={strings.headerCreateAReportLabel}
labelColorVariant="primary"
labelSpacing="lg"
>
<DropdownMenuItem
type="link"
to="fieldReportFormNew"
>
{strings.headerDropdownNewFieldReport}
</DropdownMenuItem>
<DropdownMenuItem
type="link"
to="newThreeWActivity"
>
{strings.headerDropdownNew3WActivity}
</DropdownMenuItem>
<DropdownMenuItem
type="link"
to="newDrefApplicationForm"
>
{strings.headerDropdownNewDrefApplication}
</DropdownMenuItem>
<DropdownMenuItem
type="link"
to="flashUpdateFormNew"
>
{strings.headerDropdownNewFlashUpdate}
</DropdownMenuItem>
</DropdownMenu>
</NavigationTabList>
{strings.headerDropdownNew3WActivity}
</DropdownMenuItem>
<DropdownMenuItem
type="link"
to="newDrefApplicationForm"
>
{strings.headerDropdownNewDrefApplication}
</DropdownMenuItem>
<DropdownMenuItem
type="link"
to="flashUpdateFormNew"
>
{strings.headerDropdownNewFlashUpdate}
</DropdownMenuItem>
</DropdownMenu>
</NavigationTabList>
</ListView>
</PageContainer>
<PageContainer>
<PageContainer
contentClassName={styles.bottomContent}
>
<ListView
withWrap
withSpaceBetweenContents
Expand Down
10 changes: 5 additions & 5 deletions app/src/components/Navbar/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@
border-bottom: var(--go-ui-width-separator-thin) solid var(--go-ui-color-primary-red);

.top-content {
display: flex;
align-items: center;
gap: var(--go-ui-spacing-md) var(--go-ui-spacing-lg);
flex-wrap: wrap;
padding: var(--go-ui-spacing-md) var(--go-ui-spacing-lg);
padding: var(--go-ui-spacing-sm) var(--go-ui-spacing-lg);

.brand {
display: flex;
Expand Down Expand Up @@ -104,6 +100,10 @@
}
}

.bottom-content {
padding: var(--go-ui-spacing-md) var(--go-ui-spacing-lg);
}

.search-container {
flex-basis: 30rem;
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/Page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function Page(props: Props) {
>
<ListView
layout="block"
spacing="xl"
spacing="4xl"
>
{ children }
</ListView>
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/Page/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}

.main-section {
padding: var(--go-ui-spacing-xl) var(--go-ui-spacing-lg);
padding: var(--go-ui-spacing-4xl) var(--go-ui-spacing-lg);
}
}
}
2 changes: 1 addition & 1 deletion app/src/components/TabPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function TabPage(props: Props) {
)}
<ListView
layout="block"
spacing="xl"
spacing="3xl"
>
{mainContent}
</ListView>
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/WikiLink/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.wiki-link {
.icon {
line-height: 1;
font-size: var(--go-ui-font-size-3xl);
font-size: var(--go-ui-font-size-2xl);
}
}
10 changes: 5 additions & 5 deletions app/src/components/domain/AppealsTable/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
"appealsTableStartDate": "Start Date",
"appealsTableStartDateAfter": "Start After",
"appealsTableStartDateBefore": "Start Before",
"appealsTableType": "Appeal Type",
"appealsTableCode": "Appeal Code",
"appealsTableType": "Type",
"appealsTableCode": "Code",
"appealsTableOperation": "Active Operation",
"appealsTableDisasterType": "Disaster Type",
"appealsTableRequestedAmount": "Funding Requirements",
"appealsTableFundedAmount": "Funding Coverage",
"appealsTableRequestedAmount": "Requested",
"appealsTableFundedAmount": "Funding",
"appealsTableCountry": "Country",
"appealsTableFilterTypePlaceholder": "All Appeal Types",
"appealsTableFilterDisastersPlaceholder": "All Disaster Types",
"appealsTableClearFilters": "Clear Filters",
"appealsTableFilterDistrictPlaceholder": "All Provinces",
"appealsTableProvinces": "Provinces"
}
}
}
27 changes: 13 additions & 14 deletions app/src/components/domain/AppealsTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { SortContext } from '@ifrc-go/ui/contexts';
import { useTranslation } from '@ifrc-go/ui/hooks';
import {
createDateColumn,
createNumberColumn,
createProgressColumn,
createStringColumn,
getPercentage,
Expand All @@ -31,7 +30,13 @@ import DisasterTypeSelectInput from '#components/domain/DisasterTypeSelectInput'
import DistrictSearchMultiSelectInput, { type DistrictItem } from '#components/domain/DistrictSearchMultiSelectInput';
import useGlobalEnums from '#hooks/domain/useGlobalEnums';
import useFilterState from '#hooks/useFilterState';
import { createLinkColumn } from '#utils/domain/tableHelpers';
import {
createAppealCodeColumn,
createBudgetColumn,
createCountryColumn,
createDisasterTypeColumn,
createEventColumn,
} from '#utils/domain/tableHelpers';
import type {
GoApiResponse,
GoApiUrlQuery,
Expand Down Expand Up @@ -144,15 +149,12 @@ function AppealsTable(props: Props) {
columnClassName: styles.appealType,
},
),
createStringColumn<AppealListItem, string>(
createAppealCodeColumn<AppealListItem, string>(
'code',
strings.appealsTableCode,
(item) => item.code,
{
columnClassName: styles.code,
},
),
createLinkColumn<AppealListItem, string>(
createEventColumn<AppealListItem, string>(
'operation',
strings.appealsTableOperation,
(item) => item.name,
Expand All @@ -161,20 +163,17 @@ function AppealsTable(props: Props) {
urlParams: { emergencyId: item.event },
}),
),
createStringColumn<AppealListItem, string>(
createDisasterTypeColumn<AppealListItem, string>(
'dtype',
strings.appealsTableDisasterType,
(item) => item.dtype?.name,
{ sortable: true },
),
createNumberColumn<AppealListItem, string>(
createBudgetColumn<AppealListItem, string>(
'amount_requested',
strings.appealsTableRequestedAmount,
(item) => item.amount_requested,
{
sortable: true,
suffix: ' CHF',
},
{ sortable: true },
),
createProgressColumn<AppealListItem, string>(
'amount_funded',
Expand All @@ -188,7 +187,7 @@ function AppealsTable(props: Props) {
{ sortable: true },
),
variant !== 'country'
? createLinkColumn<AppealListItem, string>(
? createCountryColumn<AppealListItem, string>(
'country',
strings.appealsTableCountry,
(item) => item.country?.name,
Expand Down
Loading
Loading