Skip to content

Commit 3025207

Browse files
committed
fix apis, add more features
1 parent 2d4be50 commit 3025207

File tree

32 files changed

+544
-434
lines changed

32 files changed

+544
-434
lines changed

public/banner.png

100644100755
-85.4 KB
Loading

public/features.png

91.1 KB
Loading

public/main-logo.png

1.23 MB
Loading

public/nylas-logo.png

25.4 KB
Loading

public/nylas-logo.svg

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/App.jsx

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ThemeProvider, createTheme } from "@mui/material/styles";
66
import { indigo, pink } from "@mui/material/colors";
77
import { useNylas } from "@nylas/nylas-react";
88
import { userGetToken } from "@app/store/authReducer/actions";
9+
import Loading from "@app/pages/Loading";
910

1011
const theme = createTheme({
1112
breakpoints: {
@@ -225,12 +226,16 @@ const darkTheme = createTheme({
225226
const App = () => {
226227
const { loading, currentUser, error } = useSelector((state) => state.auth);
227228
const [currentAuthUser, setCurrentAuthUser] = useState(currentUser);
229+
const [currentLanguage, setCurrentLanguage] = useState(null);
228230
const [currentTheme, setCurrentTheme] = useState("light");
229231

230232
const dispatch = useDispatch();
231233
const Landing = lazy(() => import("@app/pages/Landing"));
232234
const Login = lazy(() => import("@app/pages/Login"));
233235
const MailApp = lazy(() => import("@app/pages/MailApp"));
236+
const ProgrammingLanguages = lazy(() =>
237+
import("@app/pages/ProgrammingLanguages")
238+
);
234239

235240
const nylas = useNylas();
236241

@@ -240,6 +245,7 @@ const App = () => {
240245

241246
useEffect(() => {
242247
setCurrentAuthUser(JSON.parse(localStorage.getItem("user")));
248+
setCurrentLanguage(localStorage.getItem("language"));
243249
}, []);
244250

245251
useEffect(() => {
@@ -251,18 +257,20 @@ const App = () => {
251257
dispatch(userGetToken({ nylas: nylas }));
252258
}
253259
}, [nylas]);
254-
260+
console.log(currentAuthUser);
255261
return (
256-
<ThemeProvider theme={currentTheme === "light" ? theme : darkTheme}>
257-
<Suspense>
262+
<ThemeProvider theme={theme}>
263+
<Suspense fallback={<Loading />}>
258264
<Routes>
259265
<Route
260266
exact
261267
path="/"
262268
element={
263269
<>
264-
{currentAuthUser ? (
270+
{currentLanguage && currentAuthUser ? (
265271
<Navigate to={"/mail"} replace />
272+
) : !currentLanguage && currentAuthUser ? (
273+
<Navigate to={"/select"} replace />
266274
) : (
267275
<Landing />
268276
)}
@@ -274,6 +282,19 @@ const App = () => {
274282
path="/mail"
275283
element={<>{currentAuthUser ? <MailApp /> : <Login />}</>}
276284
/>
285+
<Route
286+
exact
287+
path="/select"
288+
element={
289+
<>
290+
{!currentLanguage && currentAuthUser ? (
291+
<ProgrammingLanguages />
292+
) : (
293+
<Login />
294+
)}
295+
</>
296+
}
297+
/>
277298
<Route
278299
exact
279300
path="/login"

src/components/AppHeader/index.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,18 @@ const AppHeader = ({ viewMode, handleViewModeChange }) => {
178178
<IconButton onClick={(e) => handleViewModeChange(e.target.value)}>
179179
<MenuIcon />
180180
</IconButton>
181-
<Typography
182-
variant="h1"
183-
component="div"
181+
<Box
182+
component="img"
184183
sx={{
185184
color: theme.palette.text.primary,
185+
height: "50px",
186186
cursor: "pointer",
187187
[theme.breakpoints.up("sm")]: {
188188
marginLeft: 8,
189189
},
190190
}}
191-
>
192-
Emails
193-
</Typography>
191+
src="/main-logo.png"
192+
/>
194193
</Box>
195194

196195
<Box

src/components/Banner/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ const Banner = () => {
9797
color: theme.palette.text.primary,
9898
backgroundColor: theme.palette.background.paper,
9999
padding: theme.spacing(10),
100+
paddingTop: theme.spacing(50),
100101
}}
101102
>
102103
<Container>

src/components/CallToAction/index.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const CallToAction = () => {
1515
<Box
1616
sx={{
1717
background: "#0D1549",
18-
padding: theme.spacing(6, 0), // Adjusted top and bottom padding
18+
padding: theme.spacing(6, 0),
1919
}}
2020
>
2121
<Container>
@@ -36,11 +36,11 @@ const CallToAction = () => {
3636
</Grid>
3737
<Grid item md={3} xs={12} sx={{ textAlign: "center" }}>
3838
<Button
39-
href="#"
39+
href="/login"
4040
sx={{
41-
margin: "0 auto", // Center the button horizontally
42-
width: "40%", // Make the button width 100% of its container
43-
padding: theme.spacing(2), // Adjusted padding for the button
41+
margin: "0 auto",
42+
width: "40%",
43+
padding: theme.spacing(2),
4444
borderRadius: "50px",
4545
fontSize: "16px",
4646
textTransform: "capitalize",

src/components/Faq/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const Faq = () => {
7575
mt: theme.spacing(3),
7676
}}
7777
>
78-
Frequently Asked Questions
78+
Frequently Asked Questions
7979
</Typography>
8080
{faqData.map((item) => (
8181
<Box

0 commit comments

Comments
 (0)