Skip to content

Commit 75c5c53

Browse files
authored
Merge pull request #35 from narbs91/adds-about-section
Adds blurb about what glosseta is
2 parents 8072557 + acc5c5d commit 75c5c53

4 files changed

Lines changed: 52 additions & 11 deletions

File tree

public/locales/en/common.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"web3GlossaryHeading": "Web3 Glossary",
3+
"glossetaDescription": "Glosseta is an open-source glossary meant to help people explore and learn the terminology behind web3",
34

45
"searchInputGroupAriaLabel" : "Search Bar",
56
"searchIconAriaLabel" : "Magnifying glass image",

src/pages/index.tsx

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import type { NextPage } from "next";
2-
import { HStack, VStack, Image, chakra, Heading } from "@chakra-ui/react";
2+
import {
3+
HStack,
4+
VStack,
5+
Image,
6+
chakra,
7+
Heading,
8+
Text,
9+
Box,
10+
} from "@chakra-ui/react";
311
import PageLayout from "./components/layout/page";
412
import SearchBar from "./search/search-bar";
5-
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
6-
import { useTranslation } from 'next-i18next';
13+
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
14+
import { useTranslation } from "next-i18next";
715

816
const Home: NextPage = () => {
917
const { t } = useTranslation();
@@ -13,11 +21,28 @@ const Home: NextPage = () => {
1321
<chakra.main>
1422
<VStack>
1523
<Image src="/glosseta.png" alt="Glosseta logo" width={300} />
16-
<Heading padding={1} color="white">
17-
{t('web3GlossaryHeading')}
24+
<Heading as="h1" padding={1} color="white">
25+
{t("web3GlossaryHeading")}
1826
</Heading>
1927
<HStack spacing={3}>
20-
<SearchBar baseWidth={"80vw"} smWidth={"30vw"}/>
28+
<Box width="100%" letterSpacing="wide">
29+
<Text
30+
textAlign="center"
31+
padding={2}
32+
fontSize={{ base: "xs", md: "sm" }}
33+
color="white"
34+
>
35+
{t("glossetaDescription")}
36+
</Text>
37+
</Box>
38+
</HStack>
39+
<HStack spacing={3}>
40+
<SearchBar
41+
baseWidth={"80vw"}
42+
smWidth={"50vw"}
43+
mdWidth={"50vw"}
44+
lgWidth={"30vw"}
45+
/>
2146
</HStack>
2247
</VStack>
2348
</chakra.main>
@@ -27,7 +52,7 @@ const Home: NextPage = () => {
2752

2853
export const getStaticProps = async ({ locale }: { locale: string }) => ({
2954
props: {
30-
...(await serverSideTranslations(locale, ['common'])),
55+
...(await serverSideTranslations(locale, ["common"])),
3156
},
3257
});
3358

src/pages/search/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const SearchResults = ({
2626
if (isError) {
2727
return (
2828
<PageLayout>
29-
<SearchBar baseWidth={"80vw"} smWidth={"50vw"} />
29+
<SearchBar baseWidth={"80vw"} smWidth={"50vw"} mdWidth={"50vw"} lgWidth={"30vw"} />
3030
<chakra.main>
3131
<SimpleGrid
3232
columns={1}
@@ -47,7 +47,7 @@ const SearchResults = ({
4747
return (
4848
<>
4949
<PageLayout>
50-
<SearchBar baseWidth={"80vw"} smWidth={"50vw"} />
50+
<SearchBar baseWidth={"80vw"} smWidth={"50vw"} mdWidth={"50vw"} lgWidth={"30vw"} />
5151
<chakra.main>
5252
<SimpleGrid
5353
columns={1}

src/pages/search/search-bar.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { Input, InputGroup, InputLeftElement, HStack } from "@chakra-ui/react";
33
import { useState, SetStateAction } from "react";
44
import { useTranslation } from "next-i18next";
55

6-
const SearchBar = ({ baseWidth, smWidth }: any): JSX.Element => {
6+
const SearchBar = ({
7+
baseWidth,
8+
smWidth,
9+
mdWidth,
10+
lgWidth,
11+
}: any): JSX.Element => {
712
const [searchTerm, setSearchTerm] = useState("");
813
const { t } = useTranslation();
914

@@ -36,9 +41,19 @@ const SearchBar = ({ baseWidth, smWidth }: any): JSX.Element => {
3641
color="black"
3742
rounded="lg"
3843
onChange={handleSearchTermChange}
39-
width={{ base: baseWidth, sm: smWidth }}
44+
width={{
45+
base: baseWidth,
46+
sm: smWidth,
47+
md: mdWidth,
48+
lg: lgWidth,
49+
}}
4050
type="search"
4151
id="search"
52+
placeholder="Search for a word i.e. web3"
53+
_placeholder={{
54+
color: "gray.500",
55+
fontSize: { base: "sm", sm: "md" },
56+
}}
4257
onClick={(event) => {
4358
event.currentTarget.scrollIntoView();
4459
}}

0 commit comments

Comments
 (0)