-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d27010d
commit a71b50f
Showing
23 changed files
with
698 additions
and
33 deletions.
There are no files selected for viewing
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
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
8 changes: 8 additions & 0 deletions
8
src/views/MySubscription/ActiveSubscription/SubscriptionDetail/SubscriptionActions/i18n.json
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,8 @@ | ||
{ | ||
"namespace": "SubscriptionActions", | ||
"strings": { | ||
"archiveSubscriptionActions": "Archive", | ||
"deleteSubscriptionActions": "Delete", | ||
"editSubscriptionActions": "Edit" | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/views/MySubscription/ActiveSubscription/SubscriptionDetail/SubscriptionActions/index.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,50 @@ | ||
import { MoreOptionsIcon } from '@ifrc-go/icons'; | ||
import { DropdownMenu } from '@ifrc-go/ui'; | ||
import { useTranslation } from '@ifrc-go/ui/hooks'; | ||
|
||
import DropdownMenuItem from '#components/DropdownMenuItem'; | ||
|
||
interface Props { | ||
onSubscriptionDelete: () => void; | ||
onSubscriptionArchive: () => void; | ||
} | ||
|
||
function SubscriptionActions(props: Props) { | ||
const { | ||
onSubscriptionDelete, | ||
onSubscriptionArchive, | ||
} = props; | ||
|
||
const strings = useTranslation(i18n); | ||
|
||
return ( | ||
<DropdownMenu | ||
icons={<MoreOptionsIcon />} | ||
variant="tertiary" | ||
withoutDropdownIcon | ||
> | ||
<DropdownMenuItem | ||
type="button" | ||
name="archive" | ||
onClick={onSubscriptionArchive} | ||
> | ||
{strings.archiveSubscriptionActions} | ||
</DropdownMenuItem> | ||
<DropdownMenuItem | ||
type="button" | ||
name="edit" | ||
> | ||
{strings.editSubscriptionActions} | ||
</DropdownMenuItem> | ||
<DropdownMenuItem | ||
type="button" | ||
name="delete" | ||
onClick={onSubscriptionDelete} | ||
> | ||
{strings.deleteSubscriptionActions} | ||
</DropdownMenuItem> | ||
</DropdownMenu> | ||
); | ||
} | ||
|
||
export default SubscriptionActions; |
45 changes: 45 additions & 0 deletions
45
src/views/MySubscription/ActiveSubscription/SubscriptionDetail/index.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,45 @@ | ||
import { Container } from '@ifrc-go/ui'; | ||
|
||
import SubscriptionActions from './SubscriptionActions'; | ||
|
||
import styles from './styles.module.css'; | ||
|
||
interface Props { | ||
data: any; | ||
onDelete: () => void; | ||
onArchive: () => void; | ||
} | ||
|
||
function SubscriptionDetail(props: Props) { | ||
const { | ||
data, | ||
onDelete, | ||
onArchive, | ||
} = props; | ||
|
||
return ( | ||
<Container | ||
className={styles.subscriptionDetail} | ||
> | ||
<div className={styles.subscriptionFilters}> | ||
<div className={styles.alertName}> | ||
{data.alertName} | ||
</div> | ||
<div> | ||
( | ||
{data.totalAlertCount} | ||
) | ||
<SubscriptionActions | ||
onSubscriptionDelete={onDelete} | ||
onSubscriptionArchive={onArchive} | ||
/> | ||
</div> | ||
</div> | ||
<div className={styles.filterApplied}> | ||
{data.filtersApplied} | ||
</div> | ||
</Container> | ||
); | ||
} | ||
|
||
export default SubscriptionDetail; |
19 changes: 19 additions & 0 deletions
19
src/views/MySubscription/ActiveSubscription/SubscriptionDetail/styles.module.css
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,19 @@ | ||
.subscription-detail { | ||
padding: var(--go-ui-spacing-lg); | ||
background-color: var(--go-ui-color-gray-20); | ||
|
||
.subscription-filters { | ||
display: flex; | ||
gap: var(--go-ui-spacing-lg); | ||
justify-content: space-between; | ||
|
||
.alert-name { | ||
font-weight: bold; | ||
} | ||
} | ||
|
||
.filter-applied { | ||
display: flex; | ||
gap: var(--go-ui-spacing-lg); | ||
} | ||
} |
Oops, something went wrong.