Skip to content

feat: add 'Show all tokens' toggle for owners #6325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 1, 2023
Prev Previous commit
Next Next commit
using Trans component on DeleteDialog
  • Loading branch information
Kira-Pilot committed Feb 23, 2023
commit ff2ac685d124f885eeee36daac502550017efd8d
2 changes: 1 addition & 1 deletion site/src/i18n/en/tokensPage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"emptyState": "No tokens found",
"deleteToken": {
"delete": "Delete Token",
"deleteCaption": "Are you sure you want to delete this token?",
"deleteCaption": "Are you sure you want to delete this token?<br/><br/><4>{{tokenId}}</4>",
"deleteSuccess": "Token has been deleted",
"deleteFailure": "Failed to delete token"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { FC } from "react"
import { ConfirmDialog } from "components/Dialogs/ConfirmDialog/ConfirmDialog"
import { useTranslation } from "react-i18next"
import { Typography } from "components/Typography/Typography"
import { useTranslation, Trans } from "react-i18next"
import { useDeleteToken } from "../hooks"
import { displaySuccess, displayError } from "components/GlobalSnackbar/utils"
import { getErrorMessage } from "api/errors"
Expand All @@ -13,13 +12,13 @@ export const ConfirmDeleteDialog: FC<{
}> = ({ queryKey, tokenId, setTokenId }) => {
const { t } = useTranslation("tokensPage")

const content = (
<Typography>
{t("deleteToken.deleteCaption")}
const description = (
<Trans t={t} i18nKey="deleteToken.deleteCaption" values={{ tokenId }}>
Are you sure you want to delete this token?
<br />
<br />
{tokenId}
</Typography>
{{ tokenId }}
</Trans>
)

const { mutate: deleteToken, isLoading: isDeleting } =
Expand All @@ -39,7 +38,7 @@ export const ConfirmDeleteDialog: FC<{
return (
<ConfirmDialog
title={t("deleteToken.delete")}
description={content}
description={description}
open={Boolean(tokenId) || isDeleting}
confirmLoading={isDeleting}
onConfirm={() => {
Expand Down