-
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 20464af
Showing
27 changed files
with
768 additions
and
42 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
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" | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
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,52 @@ | ||
import { MoreOptionsIcon } from '@ifrc-go/icons'; | ||
import { DropdownMenu } from '@ifrc-go/ui'; | ||
import { useTranslation } from '@ifrc-go/ui/hooks'; | ||
|
||
import DropdownMenuItem from '#components/DropdownMenuItem'; | ||
|
||
import i18n from './i18n.json'; | ||
|
||
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; |
Oops, something went wrong.