Skip to content
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

fix: gallery toolbar #483

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ export const GalleryActionToolbar = ({
data-testid="GalleryActionToolbar__template-button-mobile"
/>

{draftId !== undefined && (
<GalleryDraftDeleteButton
className="lg:hidden"
draftId={draftId}
/>
)}

<Button
icon="GridWithPencil"
iconPosition="right"
Expand Down Expand Up @@ -114,8 +121,8 @@ export const GalleryActionToolbar = ({
</div>
</div>

<div className="flex space-x-3 sm:hidden">
<div className="hidden xs:flex">
<div className="flex sm:hidden">
<div className="mr-3 hidden xs:flex">
<GalleryDraftStatus
isSavingDraft={isSavingDraft}
draftId={draftId}
Expand Down Expand Up @@ -202,7 +209,12 @@ export const GalleryActionToolbar = ({
draftId={draftId}
/>

{draftId !== undefined && <GalleryDraftDeleteButton draftId={draftId} />}
{draftId !== undefined && (
<GalleryDraftDeleteButton
className="hidden lg:flex"
draftId={draftId}
/>
)}

{showDelete && (
<IconButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import { useToasts } from "@/Hooks/useToasts";
import { useWalletDraftGalleries } from "@/Pages/Galleries/hooks/useWalletDraftGalleries";
import { assertWallet } from "@/Utils/assertions";

export const GalleryDraftDeleteButton = ({ draftId }: { draftId: number }): JSX.Element => {
export const GalleryDraftDeleteButton = ({
className,
draftId,
}: {
className?: string;
draftId: number;
}): JSX.Element => {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
const { showToast } = useToasts();
Expand Down Expand Up @@ -41,7 +47,7 @@ export const GalleryDraftDeleteButton = ({ draftId }: { draftId: number }): JSX.
<IconButton
data-testid="GalleryActionToolbar__draftDelete"
icon="Trash"
className="flex sm:hidden lg:flex"
className={className}
onClick={() => {
setOpen(true);
}}
Expand Down
Loading