Skip to content

Commit

Permalink
fix: added or adjusted button-wrappers
Browse files Browse the repository at this point in the history
  • Loading branch information
malmen237 committed Apr 23, 2024
1 parent 90d6440 commit c9515ce
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 32 deletions.
31 changes: 19 additions & 12 deletions src/components/landing-page/create-production.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const ListItemWrapper = styled.div`
position: relative;
`;

const ButtonWrapper = styled.div`
margin: 2rem 0 2rem 0;
`;

const ProductionConfirmation = styled.div`
background: #91fa8c;
padding: 1rem;
Expand Down Expand Up @@ -171,18 +175,21 @@ export const CreateProduction = () => {
/>
</div>
))}
<SecondaryButton type="button" onClick={() => append({ name: "" })}>
Add Line
</SecondaryButton>

<PrimaryButton
type="submit"
className={loading ? "with-loader" : ""}
onClick={handleSubmit(onSubmit)}
>
Create Production
{loading && <Spinner className="create-production" />}
</PrimaryButton>
<ButtonWrapper>
<SecondaryButton type="button" onClick={() => append({ name: "" })}>
Add Line
</SecondaryButton>
</ButtonWrapper>
<ButtonWrapper>
<PrimaryButton
type="submit"
className={loading ? "with-loader" : ""}
onClick={handleSubmit(onSubmit)}
>
Create Production
{loading && <Spinner className="create-production" />}
</PrimaryButton>
</ButtonWrapper>
{createdProductionId !== null && (
<ProductionConfirmation>
The production ID is: {createdProductionId.toString()}
Expand Down
21 changes: 13 additions & 8 deletions src/components/landing-page/join-production.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const FetchErrorMessage = styled.div`
margin: 1rem 0;
`;

const ButtonWrapper = styled.div`
margin: 2rem 0 2rem 0;
`;

type TProps = {
preSelected?: {
preSelectedProductionId: string;
Expand Down Expand Up @@ -241,14 +245,15 @@ export const JoinProduction = ({ preSelected }: TProps) => {
)}
</FormLabel>
)}

<PrimaryButton
type="submit"
disabled={!isValid}
onClick={handleSubmit(onSubmit)}
>
Join
</PrimaryButton>
<ButtonWrapper>
<PrimaryButton
type="submit"
disabled={!isValid}
onClick={handleSubmit(onSubmit)}
>
Join
</PrimaryButton>
</ButtonWrapper>
</>
)}
</FormContainer>
Expand Down
24 changes: 15 additions & 9 deletions src/components/manage-productions/manage-productions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const FetchErrorMessage = styled.div`
`;

const VerifyBtnWrapper = styled.div`
padding: 1rem 0 0 2rem;
margin: 3rem 0 2rem 2rem;
`;

const VerifyButtons = styled.div`
Expand All @@ -57,6 +57,10 @@ const StyledBackBtnIcon = styled.div`
margin: 0 0 3rem 0;
`;

const ButtonWrapper = styled.div`
margin: 2rem 0 2rem 0;
`;

export const ManageProductions = () => {
const [showDeleteDoneMessage, setShowDeleteDoneMessage] =
useState<boolean>(false);
Expand Down Expand Up @@ -154,14 +158,16 @@ export const ManageProductions = () => {
<>
<DecorativeLabel>Production name: {production.name}</DecorativeLabel>
{!verifyRemove && (
<PrimaryButton
type="submit"
className={deleteLoader ? "submit" : ""}
onClick={() => setVerifyRemove(true)}
>
Remove
{deleteLoader && <Spinner className="manage-production" />}
</PrimaryButton>
<ButtonWrapper>
<PrimaryButton
type="submit"
className={deleteLoader ? "submit" : ""}
onClick={() => setVerifyRemove(true)}
>
Remove
{deleteLoader && <Spinner className="manage-production" />}
</PrimaryButton>
</ButtonWrapper>
)}
{verifyRemove && (
<VerifyBtnWrapper>
Expand Down
12 changes: 9 additions & 3 deletions src/components/production-line/production-line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const UserControlBtn = styled(PrimaryButton)`
text-align: left;
`;

const LongPressWrapper = styled.div`
margin: 2rem 0 2rem 0;
`;

const ButtonWrapper = styled.span`
margin: 0 2rem 0 0;
`;
Expand Down Expand Up @@ -213,9 +217,11 @@ export const ProductionLine: FC = () => {
</ButtonIcon>
{isInputMuted ? "Muted" : "Unmuted"}
</UserControlBtn>
<LongPressToTalkButton
setMicMute={(input: boolean) => setIsInputMuted(input)}
/>
<LongPressWrapper>
<LongPressToTalkButton
setMicMute={(input: boolean) => setIsInputMuted(input)}
/>
</LongPressWrapper>
</TempDiv>
)}

Expand Down

0 comments on commit c9515ce

Please sign in to comment.