Skip to content

Commit

Permalink
feat: added nav-button as a separate component, added styling
Browse files Browse the repository at this point in the history
  • Loading branch information
malmen237 committed Apr 18, 2024
1 parent 426e8e6 commit 273fc53
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/components/landing-page/landing-page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { useNavigate } from "react-router-dom";
import { JoinProduction } from "./join-production.tsx";
import { CreateProduction } from "./create-production.tsx";
import { ProductionsList } from "./productions-list.tsx";
import { useNavigateToProduction } from "./use-navigate-to-production.ts";
import { DisplayContainer, FlexContainer } from "../generic-components.ts";
import { useGlobalState } from "../../global-state/context-provider.tsx";
import { ActionButton } from "./form-elements.tsx";
import { isMobile } from "../../bowser.ts";
import { ManageProductionButton } from "../manage-productions/manage-production-button.tsx";

export const LandingPage = () => {
const [{ joinProductionOptions }] = useGlobalState();
const navigate = useNavigate();

useNavigateToProduction(joinProductionOptions);

Expand All @@ -27,12 +25,7 @@ export const LandingPage = () => {
)}
</FlexContainer>
<ProductionsList />
<ActionButton
type="button"
onClick={() => navigate("/manage-productions")}
>
Manage Productions
</ActionButton>
<ManageProductionButton />
</>
);
};
24 changes: 24 additions & 0 deletions src/components/manage-productions/manage-production-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { useNavigate } from "react-router-dom";
import styled from "@emotion/styled";
import { ActionButton } from "../landing-page/form-elements";

const ButtonWrapper = styled.div`
display: flex;
justify-content: end;
padding: 2rem;
`;

export const ManageProductionButton = () => {
const navigate = useNavigate();

return (
<ButtonWrapper>
<ActionButton
type="button"
onClick={() => navigate("/manage-productions")}
>
Manage Productions
</ActionButton>
</ButtonWrapper>
);
};

0 comments on commit 273fc53

Please sign in to comment.