Skip to content

Commit

Permalink
feat(web): visually update snapshot modal
Browse files Browse the repository at this point in the history
  • Loading branch information
LordTermor committed Sep 2, 2024
1 parent 9e5fabd commit b2ee97a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions web/src/components/SectionSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function SectionSelect({
<daisyui.Dropdown>
<components.Control
className={
"input input-bordered input-sm bg-base-100 " +
"input input-bordered input-sm bg-base-100 w-full" +
classNames
}
{...rest}
Expand Down Expand Up @@ -130,7 +130,7 @@ export default function SectionSelect({
);

return (
<span className="flex justify-stretch items-center w-full space-x-1">
<span className="flex justify-between items-center w-full space-x-1">
<Select<IOption>
unstyled={true}
components={makeComponents(faCodeBranch)}
Expand Down
12 changes: 11 additions & 1 deletion web/src/modals/SnapshotModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { Button, Form, Modal, ModalProps, Select } from "react-daisyui";
import { createPortal } from "react-dom";
import axios from "axios";
import SectionSelect from "../components/SectionSelect";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faArrowDown, faCopy } from "@fortawesome/free-solid-svg-icons";

export type ISnapshotModalProps = ModalProps & {
sections: Section[];
Expand All @@ -33,6 +35,7 @@ export const SnapshotModal = forwardRef<HTMLDialogElement, ISnapshotModalProps>(
useEffect(() => {
setSourceSection({
...props.sections.at(0),
...{ repository: undefined },
...props.sourceSection
});
}, [props.sourceSection, props.sections]);
Expand Down Expand Up @@ -82,17 +85,24 @@ export const SnapshotModal = forwardRef<HTMLDialogElement, ISnapshotModalProps>(

return createPortal(
<Modal ref={internalRef} {...props}>
<h1 className="text-3xl font-bold">Snapshot</h1>
<h1 className="text-3xl font-bold">
<FontAwesomeIcon className="pr-2" size="xs" icon={faCopy} />
Snapshot
</h1>
<Form>
<Form.Label title="Source section" />
<SectionSelect
disabled={[false, true, false]}
selectedSection={sourceSection}
sections={props.sections}
onSelected={(value) => {
setSourceSection(value);
}}
/>
</Form>
<div className="flex justify-center my-4">
<FontAwesomeIcon icon={faArrowDown} className="h-6 w-6" />
</div>

<Form>
<Form.Label title="Target section" />
Expand Down

0 comments on commit b2ee97a

Please sign in to comment.