'Coin Site Project'

[TIL/Coin Site Project] 2023/12/05

Home Page Layout โœ๏ธ PageContainer.jsx ๐ŸŸข

2023๋…„ 12์›” 5์ผ2min read

Home Page Layout โœ๏ธ

code
import React from "react";
import { Box } from "@mui/material";

import PageContainer from "../components/layout/common/PageContainer";
import ComponentWrapper from "../components/layout/common/ComponentWrapper";
import Table from "../components/home/Table";

const Home = () => {
  return (
    <>
      <PageContainer>
        <ComponentWrapper>
          <Box sx={{ height: "auto" }}>
            {/* Card Area */}
            <Box sx={{ display: "flex", columnGap: "60px", padding: "60px 0" }}>
              <Box
                sx={{
                  backgroundColor: "#0e1821",
                  width: "360px",
                  border: "none",
                  height: "200px",
                  borderRadius: "15px",
                  transition: "opacity 0.3s ease",
                  "&:hover": {
                    opacity: 0.8,
                  },
                }}
              >
                <p
                  style={{
                    textAlign: "center",
                    color: "white",
                    fontWeight: "bolder",
                  }}
                >
                  'Trending' rendering
                </p>
                <p
                  style={{
                    textAlign: "center",
                    color: "white",
                    fontWeight: "bolder",
                  }}
                >
                  ์Šค๋ฅด๋ฅต ์˜ˆ์ •
                </p>
              </Box>
              <Box
                sx={{
                  backgroundColor: "#0e1821",
                  width: "360px",
                  border: "none",
                  height: "200px",
                  borderRadius: "15px",
                  transition: "opacity 0.3s ease",
                  "&:hover": {
                    opacity: 0.8,
                  },
                }}
              >
                <p
                  style={{
                    textAlign: "center",
                    color: "white",
                    fontWeight: "bolder",
                  }}
                >
                  'News' rendering
                </p>
                <p
                  style={{
                    textAlign: "center",
                    color: "white",
                    fontWeight: "bolder",
                  }}
                >
                  ์Šค๋ฅด๋ฅต ์˜ˆ์ •
                </p>
              </Box>
              <Box
                sx={{
                  backgroundColor: "#0e1821",
                  width: "360px",
                  border: "none",
                  height: "200px",
                  borderRadius: "15px",
                  transition: "opacity 0.3s ease",
                  "&:hover": {
                    opacity: 0.8,
                  },
                }}
              >
                <p
                  style={{
                    textAlign: "center",
                    color: "white",
                    fontWeight: "bolder",
                  }}
                >
                  'Fear & Greed Index' rendering
                </p>
                <p
                  style={{
                    textAlign: "center",
                    color: "white",
                    fontWeight: "bolder",
                  }}
                >
                  ์Šค๋ฅด๋ฅต ์˜ˆ์ •
                </p>
              </Box>
            </Box>
            {/* Table Area */}
            <Table />
          </Box>
        </ComponentWrapper>
      </PageContainer>
    </>
  );
};

export default Home;

PageContainer.jsx ๐ŸŸข

Appbar์™€ Footer ์‚ฌ์ด์— ์ถ”๊ฐ€๋  Box Area์— ๊ด€ํ•œ ๋…ผ์˜์ด๋‹ค.

PageContainer๋ฅผ ํ†ตํ•ด ๋ง ๊ทธ๋Œ€๋กœ 'ํŽ˜์ด์ง€๋ฅผ ๊ฐ์Œ€ ๊ฒฝ์šฐ', ํ•ด๋‹น ํŽ˜์ด์ง€์˜ ๋‚ด์šฉ์€ Appbar์™€ Footer ์‚ฌ์ด์— ์œ„์น˜ํ•˜๊ฒŒ ๋œ๋‹ค.

์ด๋–„, ๋ณด์—ฌ์ง€๋Š” ์ตœ์†Œํ•œ์˜ ๋„“์ด์™€ ๋†’์ด๋Š” '์‚ฌ์šฉ์ž ๊ธฐ๊ธฐ์˜ view'๋งŒํผ์œผ๋กœ ์„ค์ •๋œ๋‹ค. ์ถ”๊ฐ€์ ์œผ๋กœ 'flex-grow: 1'์„ ํ†ตํ•ด ํŽ˜์ด์ง€์˜ ๋‚ด์šฉ์ด Appbar์™€ Footer ์‚ฌ์ด์— ๋ชจ๋‘ ๋‹ด์•„์ง€๋„๋ก ๋‚ด์šฉ์„ ๊ตฌ์„ฑํ–ˆ๋‹ค.

code
import Appbar from "../appbar/Appbar";
import Footer from "../footer/Footer";
import { Box } from "@mui/material";

const PageContainer = ({ children }) => {
  return (
    <>
      <Appbar />
      <Box
        sx={{
          minHeight: "100vh",
          minWidth: "100vw",
          flexGrow: 1,
          backgroundColor: "#232531",
        }}
      >
        {children}
      </Box>
      <Footer />
    </>
  );
};

export default PageContainer;

ComponentWrapper.jsx ๐ŸŸข

๊ฒฝ์šฐ์— ๋”ฐ๋ผ์„œ, page์˜ ์ „์ฒด px์„ ์ฐจ์ง€ํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ๋„ ์žˆ์ง€๋งŒ, component๋ฅผ 1200px๋กœ ์ œํ•œํ•  ํ•„์š”๋„ ์žˆ๋‹ค.

๊ฐ€๋ น 'banner'๋Š” ์ „์ฒด ํŽ˜์ด์ง€ width๋ฅผ ์ฐจ์ง€ํ•˜๋„๋ก ์„ค์ •ํ•˜๊ณ  ์‹ถ๊ณ , ๋™์‹œ์— 'page์˜ ๋‚ด์šฉ'์— ๊ด€ํ•œ ๋ถ€๋ถ„์€ 1200px์ด๋ผ๋Š” ์ผ๊ด€๋œ layout์„ ํ†ตํ•ด ๋ณด์—ฌ์ฃผ๊ณ  ์‹ถ๋‹ค๋ฉด, banner๋Š” PageContainer์— ์…‹ํŒ…ํ•˜๊ณ , ๋‚˜๋จธ์ง€ ๋‚ด์šฉ์€ ComponentWrapper๋กœ ๊ฐ์‹ธ๋ฉด ๋œ๋‹ค.

code
import React from "react";
import { Box } from "@mui/material";

const ComponentWrapper = ({ style, children }) => {
  return (
    <Box
      style={style}
      sx={{
        maxWidth: "1200px",
        margin: "0 auto",
        height: "auto",
        width: "100%",
      }}
    >
      {children}
    </Box>
  );
};

export default ComponentWrapper;

ํ˜„์žฌ ๋ชจ์Šต ๐ŸŸข

More to read

AI

AI&ML ๊ธฐ์ดˆ

Reference: https&#x3A;//bettermesol.github.io/ml/2019/09/16/ai-ml-dl/AI: ๊ธฐ๊ณ„๊ฐ€ ์‚ฌ๋žŒ์ฒ˜๋Ÿผ ์ƒ๊ฐํ•˜๊ณ  ํŒ๋‹จํ•˜๊ฒŒ ๋งŒ๋“œ๋Š” ๊ฐ€์žฅ ๋„“์€ ๋ฒ”์ฃผ์˜ ๊ธฐ์ˆ ์ž…๋‹ˆ๋‹ค.ML: ๋ฐ์ดํ„ฐ๋ฅผ ํ•™์Šตํ•˜์—ฌ ์Šค์Šค๋กœ ๊ทœ์น™์„ ์ฐพ์•„๋‚ด๋Š” AI์˜ ํ•œ ๋ถ„์•ผ๋กœ,

'AI Agent Economy'

Novitas : AI Agent๊ฐ€ ์ง€๊ฐ‘์„ ๊ฐ€์ง€๋Š” ์„ธ์ƒ

์–ผ๋งˆ ์ „, ๋ฏธ๋ž˜์—์…‹์ฆ๊ถŒ ๋ฆฌ์„œ์น˜ ๋ฆฌํฌํŠธ(์˜ฌํ•ด๋Š” ์ด๋”๋ฆฌ์›€์ด๋‹ค: ์—์ด์ „ํŠธ ์‹œ๋Œ€์˜ Near Automata)๋ฅผ ์ ‘ํ•˜๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. AI Agent๋ฅผ ์ธ๊ฐ„๊ณผ ํ•จ๊ป˜ํ•  ๊ฒฝ์ œ ์ฃผ์ฒด๋กœ ๋ฐ”๋ผ๋ณด๋Š” ์‹œ๊ฐ์— ์ ์ž–์ด ์ถฉ๊ฒฉ์„ ๋ฐ›์•˜๋”๋žฌ์ฃ .ํ•œ ๊ฐ€์ง€ ์งš๊ณ  ๋„˜์–ด๊ฐˆ ๋ถ€๋ถ„์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๊ฐ€ ํ”ํžˆ 'AI'

'ERC-8004'

Novitas: AI ์—์ด์ „ํŠธ ๊ฒฝ์ œ ์ฃผ์ฒด

Web 4.0์„ ํ•œ ๋ฌธ์žฅ์œผ๋กœ ์ •์˜ํ•˜๋ฉด Sovereign Transact์ž…๋‹ˆ๋‹ค.AI๊ฐ€ ์ธ๊ฐ„์˜ ํ—ˆ๋ฝ ์—†์ด ์ง€๊ฐ‘์„ ์†Œ์œ ํ•˜๊ณ , ๊ฒฐ์ œ๋ฅผ ์ˆ˜ํ–‰ํ•˜๋ฉฐ, ์ธํ”„๋ผ๋ฅผ ํ†ต์ œํ•˜๋Š” ์ฃผ๊ถŒ์  ๊ฒฝ์ œ ์ฃผ์ฒด๊ฐ€ ๋˜๋Š” ์„ธ๊ณ„์ž…๋‹ˆ๋‹ค. Web 3.0์ด ๋ธ”๋ก์ฒด์ธ ๊ธฐ๋ฐ˜์˜ ํƒˆ์ค‘์•™ํ™”๋ฅผ ์‹คํ˜„ํ–ˆ๋‹ค๋ฉด, Web 4.0์€ ๊ทธ