-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): add permissioned warning when creating campaigns (#447)
* feat(frontend): add permissioned warning when creating campaings * docs: add changeset * fix(frontend): add missing wallet disconnected warning for permissioned * fix(frontend): add screen height for campaigns and creation pages * feat(frontend): make back button variant primary * feat(frontend): add new permissioned mode message * fix(frontend): move condition into existing ternary operator * fix(frontend): make the loading state the first
- Loading branch information
Showing
6 changed files
with
143 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@carrot-kpi/host-frontend": minor | ||
--- | ||
|
||
Add permissioned mode warning when creating campaigns |
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,55 @@ | ||
import React from "react"; | ||
import { t } from "i18next"; | ||
import ErrorIcon from "../../icons/error"; | ||
import { Button, Typography } from "@carrot-kpi/ui"; | ||
import { useAccount } from "wagmi"; | ||
import WalletDisconnected from "../../icons/wallet-disconnected"; | ||
|
||
interface PermissionedProps { | ||
onBack: () => void; | ||
} | ||
|
||
export const Permissioned = ({ onBack }: PermissionedProps) => { | ||
const { address } = useAccount(); | ||
|
||
return ( | ||
<div className="w-full h-full flex justify-center"> | ||
<div className="h-fit flex flex-col gap-4 items-center p-8 max-w-lg rounded-xl border border-black dark:border-white bg-white dark:bg-black mx-4"> | ||
{address ? ( | ||
<> | ||
<ErrorIcon className="w-40 h-40 fill-orange stroke-orange" /> | ||
<Typography | ||
variant="xl" | ||
weight="bold" | ||
className={{ root: "text-center" }} | ||
> | ||
{t("permissioned.mode.title")} | ||
</Typography> | ||
<Typography | ||
className={{ | ||
root: "text-center mb-4", | ||
}} | ||
> | ||
{t("permissioned.mode.description")} | ||
</Typography> | ||
<Button size="small" onClick={onBack}> | ||
{t("permissioned.mode.back")} | ||
</Button> | ||
</> | ||
) : ( | ||
<> | ||
<WalletDisconnected className="w-52" /> | ||
<div className="flex flex-col gap-3 items-center"> | ||
<Typography variant="h4"> | ||
{t("wallet.disconnected.title")} | ||
</Typography> | ||
<Typography> | ||
{t("wallet.disconnected.description")} | ||
</Typography> | ||
</div> | ||
</> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
}; |
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