From 97fef2a3de5473bad66d289baa0ee51b322dfc0d Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 19 Apr 2024 17:04:38 -0400 Subject: feat: Add ternary to conditionally render GridLayout if a user is logged in --- src/pages/Contact.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/pages/Contact.js') diff --git a/src/pages/Contact.js b/src/pages/Contact.js index e174b9a..dfcc05a 100644 --- a/src/pages/Contact.js +++ b/src/pages/Contact.js @@ -1,3 +1,23 @@ -export default function ContactUs() { - return

dont contact us pls

-} \ No newline at end of file +import React, { useContext } from 'react'; +import { AuthContext } from '../providers/AuthContext'; +import GridLayout from '../layouts/GridLayout'; + +const ContactUs = () => { + const { user } = useContext(AuthContext); + + return ( + <> + {!user ? ( +

don't contact us pls

+ ) : ( + + <> + don't contact us pls + + + )} + + ); +}; + +export default ContactUs; \ No newline at end of file -- cgit v1.2.3-70-g09d2