Skip to content

Commit

Permalink
Merge pull request #24 from CS633SP23Team4/custom-recipe-page
Browse files Browse the repository at this point in the history
feat: Custom recipe page
  • Loading branch information
hetd54 committed Feb 26, 2024
2 parents 468c89d + e50daf5 commit 13b9894
Show file tree
Hide file tree
Showing 9 changed files with 417 additions and 183 deletions.
9 changes: 7 additions & 2 deletions firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ rules_version = '2';

service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
match /users/{userId} {
allow read, update, delete: if request.auth != null && request.auth.uid == userId;
allow create: if request.auth != null;
}
match /userRecipes/{userId} {
allow read, update, delete: if request.auth != null && request.auth.uid == userId;
allow create: if request.auth != null;
}
}
}
8 changes: 7 additions & 1 deletion src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ export function HamburgerMenu(props) {
key={route.id}
as={ReactRouterLink}
to={route.path}
state={{
user: props.user,
}}
_activeLink={{ fontWeight: "bold", borderBottom: "2px" }}
>
{route.name}
Expand Down Expand Up @@ -120,7 +123,7 @@ export function HamburgerMenu(props) {
}

export default function Navbar() {
const [user, setUser] = useState(null)
const [user, setUser] = useState(localStorage.getItem("user"))

const setUserFunc = (user) => {
setUser(user)
Expand Down Expand Up @@ -152,6 +155,9 @@ export default function Navbar() {
<BreadcrumbLink
as={ReactRouterLink}
to={route.path}
state={{
user: user,
}}
_activeLink={{ fontWeight: "bold", borderBottom: "2px" }}
>
<Text>{route.name}</Text>
Expand Down
14 changes: 2 additions & 12 deletions src/components/form/FormWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Box, Heading } from "@chakra-ui/react"
import PropTypes from "prop-types"
import { PrimaryButton } from "./CustomButton"

FormWrapper.propTypes = {
header: PropTypes.string,
Expand All @@ -14,6 +13,7 @@ export function FormWrapper({ children, header }) {
base: "6",
md: "24",
}}
bg="white"
align="center"
justifyContent="center"
>
Expand All @@ -22,17 +22,7 @@ export function FormWrapper({ children, header }) {
<Heading>{header}</Heading>
</Box>
<Box my={4} textAlign="left">
<form>
{children}
<PrimaryButton
bg="brand.900"
color="gray.50"
width="full"
mt={4}
type="submit"
text="Submit"
/>
</form>
{children}
</Box>
</Box>
</Box>
Expand Down
Loading

0 comments on commit 13b9894

Please sign in to comment.