|
1 | | -"use client"; |
| 1 | +import { Metadata } from "next"; |
| 2 | +import { Container, Typography, List, ListItem, Box } from "@mui/material"; |
| 3 | +import { Button } from "@/components/buttons"; |
| 4 | +import Link from "next/link"; |
| 5 | +import Image from "next/legacy/image"; |
| 6 | +import { CATEGORIES_ROUTE } from "@/types"; |
| 7 | +import { authConfig } from "@/configs"; |
| 8 | +import { getServerSession } from "next-auth"; |
2 | 9 |
|
3 | | -import { Grid2, useMediaQuery, useTheme } from "@mui/material"; |
4 | | -import { CreateCategoryButton, CategoriesList } from "@/components/categories"; |
5 | | -import { SearchInput } from "@/components/inputs"; |
6 | | -import { MainLayout } from "@/components/MainLayout"; |
7 | | -import { FiltersModal } from "@/components/modals"; |
8 | | -import { CATEGORY_TYPE } from "@/types"; |
9 | | -import { useGetLabels } from "@/api"; |
| 10 | +export const metadata: Metadata = { |
| 11 | + title: "About My Lib - Your Personal Code Library", |
| 12 | + description: |
| 13 | + "My Lib is a simple and efficient way to store, organize, and reuse code snippets, scripts, configurations, and more. Create your own personal library with frontend, backend, and any programming languages.", |
| 14 | + robots: "index, follow", |
| 15 | +}; |
10 | 16 |
|
11 | | -const Home = () => { |
12 | | - const theme = useTheme(); |
13 | | - const isMobile = useMediaQuery(theme.breakpoints.down("sm")); |
14 | | - useGetLabels({ labelType: CATEGORY_TYPE }); |
| 17 | +const LandingPage = async () => { |
| 18 | + const session = await getServerSession(authConfig); |
| 19 | + const userId = session?.user?.id; |
15 | 20 |
|
16 | 21 | return ( |
17 | | - <MainLayout title="Categories"> |
18 | | - <Grid2 |
19 | | - container |
20 | | - justifyContent="space-between" |
21 | | - direction={{ xs: "column-reverse", sm: "row" }} |
22 | | - alignItems="center" |
23 | | - gap={2} |
24 | | - flexWrap="nowrap" |
25 | | - > |
26 | | - <CreateCategoryButton fullWidth={isMobile} /> |
27 | | - |
28 | | - <Grid2 |
29 | | - container |
30 | | - alignItems="center" |
31 | | - gap={2} |
32 | | - ml={{ xs: 0, sm: "auto" }} |
33 | | - flexWrap="nowrap" |
34 | | - width={{ xs: "100%", sm: "auto" }} |
| 22 | + <Container maxWidth="lg" sx={{ py: 8 }}> |
| 23 | + <Typography component="h1" variant="h2" my={3} textAlign="center"> |
| 24 | + My Lib: Your Universal Code & Knowledge Organizer for IT Professionals |
| 25 | + </Typography> |
| 26 | + |
| 27 | + <Typography fontSize={18}> |
| 28 | + My Lib is an intuitive platform built for developers, DevOps engineers, |
| 29 | + IT specialists, and anyone working with code or technical information. |
| 30 | + More than just a snippet manager, it’s a versatile workspace to organize |
| 31 | + your knowledge |
| 32 | + </Typography> |
| 33 | + |
| 34 | + <Box display="flex" gap={3} justifyContent="center" my={5}> |
| 35 | + {userId ? ( |
| 36 | + <Button |
| 37 | + size="large" |
| 38 | + variant="contained" |
| 39 | + href={CATEGORIES_ROUTE} |
| 40 | + component={Link} |
| 41 | + sx={{ width: "20%", height: 40 }} |
| 42 | + > |
| 43 | + Continue |
| 44 | + </Button> |
| 45 | + ) : ( |
| 46 | + <Button |
| 47 | + size="large" |
| 48 | + variant="contained" |
| 49 | + href="/login" |
| 50 | + component={Link} |
| 51 | + sx={{ width: "20%", height: 40 }} |
| 52 | + > |
| 53 | + Sign in |
| 54 | + </Button> |
| 55 | + )} |
| 56 | + </Box> |
| 57 | + |
| 58 | + <Typography variant="h2" my={3} textAlign="center"> |
| 59 | + What Makes My Lib Indispensable? |
| 60 | + </Typography> |
| 61 | + |
| 62 | + <Typography fontSize={18} mb={2}> |
| 63 | + 🚀 Build Your Personal Code Library Save code snippets in any language |
| 64 | + (JavaScript, Python, Go, SQL, etc.) for frontend, backend, mobile |
| 65 | + development, or automation tasks. The built-in code editor with syntax |
| 66 | + highlighting ensures a seamless coding experience. |
| 67 | + </Typography> |
| 68 | + |
| 69 | + <Typography fontSize={18} mb={2}> |
| 70 | + 📂 Organize Beyond Code Store server configurations, instructions, |
| 71 | + documentation, checklists, bookmarks, and even images. The rich text |
| 72 | + editor lets you format content, add tables, lists, and embed media. |
| 73 | + </Typography> |
| 74 | + |
| 75 | + <Typography fontSize={18} mb={2}> |
| 76 | + 🏷️ Instant Access with Categories & Labels Sort data into customizable |
| 77 | + categories and apply labels for precise filtering. Examples: “Docker |
| 78 | + Configs,” “React Hooks,” “SQL Templates.” |
| 79 | + </Typography> |
| 80 | + |
| 81 | + <Typography fontSize={18}> |
| 82 | + 🔍 Find Anything in Seconds Search by category names, labels, or content |
| 83 | + within code items—no more digging through messy folders, old projects, |
| 84 | + or dozens of repositories. Stop wasting time scrolling through forums or |
| 85 | + GitHub to rediscover solutions you’ve already used. With My Lib, every |
| 86 | + piece of code, configuration, or knowledge you’ve saved is just a quick |
| 87 | + search away. |
| 88 | + </Typography> |
| 89 | + |
| 90 | + <Box display={{ xs: "none", md: "block" }}> |
| 91 | + <Typography component="h3" variant="h2" my={5} textAlign="center"> |
| 92 | + Example of usage: |
| 93 | + </Typography> |
| 94 | + |
| 95 | + <Typography variant="h4" mb={2}> |
| 96 | + Home page with categories: |
| 97 | + </Typography> |
| 98 | + |
| 99 | + <Box height={560} width={1} position="relative" overflow="hidden"> |
| 100 | + <Image |
| 101 | + src="/about/categories.png" |
| 102 | + alt="Categories example" |
| 103 | + objectFit="contain" |
| 104 | + layout="fill" |
| 105 | + quality={100} |
| 106 | + /> |
| 107 | + </Box> |
| 108 | + |
| 109 | + <Typography variant="h4" my={2}> |
| 110 | + Code items inside category: |
| 111 | + </Typography> |
| 112 | + |
| 113 | + <Box |
| 114 | + height={560} |
| 115 | + width={1} |
| 116 | + position="relative" |
| 117 | + mt={2} |
| 118 | + overflow="hidden" |
35 | 119 | > |
36 | | - <SearchInput /> |
| 120 | + <Image |
| 121 | + src="/about/code-items-styles.png" |
| 122 | + alt="Code items example" |
| 123 | + objectFit="contain" |
| 124 | + layout="fill" |
| 125 | + quality={100} |
| 126 | + /> |
| 127 | + </Box> |
| 128 | + </Box> |
37 | 129 |
|
38 | | - <FiltersModal labelType={CATEGORY_TYPE} /> |
39 | | - </Grid2> |
40 | | - </Grid2> |
| 130 | + <Typography component="h4" variant="h2" my={3} textAlign="center"> |
| 131 | + Key Features |
| 132 | + </Typography> |
41 | 133 |
|
42 | | - <CategoriesList /> |
43 | | - </MainLayout> |
| 134 | + <List sx={{ fontSize: 18 }}> |
| 135 | + <ListItem> |
| 136 | + Create custom categories like Components, Configs, Helpers, Styles. |
| 137 | + </ListItem> |
| 138 | + <ListItem> |
| 139 | + Assign labels (e.g., FE, BE, env, MUI) for easy filtering. |
| 140 | + </ListItem> |
| 141 | + <ListItem>Search categories by name for quick access.</ListItem> |
| 142 | + <ListItem> |
| 143 | + Add rich descriptions with a powerful editor supporting text |
| 144 | + formatting, code snippets, images, links, and more. |
| 145 | + </ListItem> |
| 146 | + <ListItem> |
| 147 | + Use Monaco Editor for syntax highlighting and better coding |
| 148 | + experience. |
| 149 | + </ListItem> |
| 150 | + <ListItem> |
| 151 | + Fast filter and search code items by tags and names. |
| 152 | + </ListItem> |
| 153 | + </List> |
| 154 | + </Container> |
44 | 155 | ); |
45 | 156 | }; |
46 | 157 |
|
47 | | -export default Home; |
| 158 | +export default LandingPage; |
0 commit comments