update create account flow

This commit is contained in:
Ren Amamiya
2023-09-14 09:20:36 +07:00
parent 5a6dd172b1
commit 8e513404c3
11 changed files with 180 additions and 162 deletions

View File

@@ -2,14 +2,14 @@ import { Dispatch, SetStateAction, useState } from 'react';
import { LoaderIcon, PlusIcon } from '@shared/icons';
import { useImageUploader } from '@utils/hooks/useUploader';
import { useNostr } from '@utils/hooks/useNostr';
export function AvatarUploader({
setPicture,
}: {
setPicture: Dispatch<SetStateAction<string>>;
}) {
const upload = useImageUploader();
const { upload } = useNostr();
const [loading, setLoading] = useState(false);
const uploadAvatar = async () => {

View File

@@ -2,14 +2,14 @@ import { Dispatch, SetStateAction, useState } from 'react';
import { LoaderIcon, PlusIcon } from '@shared/icons';
import { useImageUploader } from '@utils/hooks/useUploader';
import { useNostr } from '@utils/hooks/useNostr';
export function BannerUploader({
setBanner,
}: {
setBanner: Dispatch<SetStateAction<string>>;
}) {
const upload = useImageUploader();
const { upload } = useNostr();
const [loading, setLoading] = useState(false);
const uploadBanner = async () => {
@@ -25,13 +25,14 @@ export function BannerUploader({
<button
type="button"
onClick={() => uploadBanner()}
className="inline-flex h-full w-full items-center justify-center bg-black/40 hover:bg-black/50"
className="inline-flex h-full w-full flex-col items-center justify-center gap-1 bg-black/40 hover:bg-black/50"
>
{loading ? (
<LoaderIcon className="h-8 w-8 animate-spin text-white" />
<LoaderIcon className="h-6 w-6 animate-spin text-white" />
) : (
<PlusIcon className="h-8 w-8 text-white" />
<PlusIcon className="h-6 w-6 text-white" />
)}
<p className="text-sm font-medium text-white/70">Add a banner image</p>
</button>
);
}