[ToyProject-Todomate] ํˆฌ๋‘๋ฉ”์ดํŠธ ํด๋ก  ํ”„๋กœ์ ํŠธ 11

2021. 12. 19. 15:06ใ†WEB Dev/ToyProject

728x90


๐Ÿ”ท CloneTodo โ˜‘ - Todomate Clone Project  |  Team CloneMate

 

CloneTodo : ๋งŽ์€ ์‚ฌ๋žŒ๋“ค์ด ์‚ฌ๋ž‘ํ•˜๋Š” ํˆฌ๋‘๋ฉ”์ดํŠธ๋ฅผ ํด๋ก ํ•˜์—ฌ ์›น ์„œ๋น„์Šค๋ฅผ ๋ฐฐํฌํ•ด๋ณด๋Š” ํ”„๋กœ์ ํŠธ

 


 

์‚ฌํ˜๋™์•ˆ ๋ฆฌ์•กํŠธ๋ฅผ ๋งŒ์ง€์ง€ ๋ชปํ–ˆ๋‹ค. ํšŒ์‚ฌ ์ผ์ด ๋งŽ์•„์„œ ์ง‘์— ์˜ค๋ฉด ์ง€์ณ ์“ฐ๋Ÿฌ์ง ๐Ÿ˜’

์˜ค๋Š˜ ํ•  ์ผ์€ ์ตœ๋Œ€ํ•œ ๋งŽ์€ ํŽ˜์ด์ง€ ๊ตฌํ˜„ํ•˜๊ธฐ!

๋งˆํฌ์—…๊ณผ CSS๋Š” ๋™์‹œ์— ๋งŒ์ง€๋˜, CSS๋Š” ์•„์ฃผ ๊ฐ„๋‹จํ•˜๊ฒŒ ๊ตฌ์„ฑ๋งŒ ์žก๋Š” ๊ฒƒ์œผ๋กœ ํ•˜๊ณ  ์ถ”ํ›„ SCSS ๋ฅผ ์ ์šฉํ•ด๋ณผ๊นŒ ํ•œ๋‹ค.

MUI๊ฐ€ ๊ธฐ๋ณธ์ ์ธ CSS๋Š” ์žก์•„์ฃผ๊ธฐ ๋•Œ๋ฌธ์— ๋ ˆ์ด์•„์›ƒ๋งŒ ์ˆ˜์ •ํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™์€๋ฐ.. 

 

์˜ค๋Š˜์˜ todo

 

โ–ก ๊ฐ€์ž…ํ•˜๊ธฐ ์ปดํฌ๋„ŒํŠธ

โ–ก ๊ธฐ๋ณธ NavBar ์ปดํฌ๋„ŒํŠธ

โ–ก ๋ฉ”์ธ NavBar ์ปดํฌ๋„ŒํŠธ

โ–ก ๋ฉ”์ธ Feed ์ปดํฌ๋„ŒํŠธ

 

โž• ๊ฐ€๋Šฅํ•˜๋ฉด ๊นƒํ—™ ํ˜ธ์ŠคํŒ…์œผ๋กœ ๋ฐฐํฌ๊นŒ์ง€

 

1. ๊ฐ€์ž…ํ•˜๊ธฐ ์ปดํฌ๋„ŒํŠธ 

1) ์ปดํฌ๋„ŒํŠธ ๋งŒ๋“ค๊ธฐ 

 

๊ฐ€์ž…ํ•˜๊ธฐ ์ปดํฌ๋„ŒํŠธ์—๋Š” Join ์ด๋ผ๋Š” ์ด๋ฆ„์ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ํŒŒ์ผ๋ช…์„ Join.js๋กœ ๋งŒ๋“ค์–ด์ค€๋‹ค.

 

import React from 'react';


function Join(){




}

export default Join;

 

2) ๋ผ์šฐํ„ฐ์— ์—ฐ๊ฒฐ

Join์„ App.js์˜ ๊ฐ€์ž…ํ•˜๊ธฐ ๋ฒ„ํŠผ์— ์—ฐ๊ฒฐํ•ด์ค€๋‹ค.

 

import React from "react";
import "../stylesheets/App.css";
import { Button  } from "@mui/material";
import { ThemeProvider, createTheme } from "@mui/material/styles";
import { Switch, Route, useHistory } from "react-router-dom";

import Signin from "./Signin";
import Join from "./Join";

const theme = createTheme({
  status: {
    danger: "#e53e3e",
  },
  palette: {
    primary: {
      main: "#0971f1",
      darker: "#053e85",
    },
    neutral: {
      main: "#64748B",
      contrastText: "#fff",
    },
    btn: {
      main: "#f2f2f2",
      contrastText: "#111",
    },
  },
});

function App() {
  let history = useHistory();

  return (
    <ThemeProvider theme={theme}>
      <Switch>
        <Route exact path="/">
          <div className="App">
            <div className="header">
              <img className="main_img" src="images/todomate.jpg" />
              <h1>todo mate</h1>
              <h3>ํ•  ์ผ์„ ์ž‘์„ฑ, ๊ณ„ํš, ๊ด€๋ฆฌํ•˜์„ธ์š”.</h3>
            </div>
            <div className="start_btn">
              <Button 
                className="join_btn" 
                color="btn"
                variant="contained" 
                onClick={() => {
                  history.push("/join");
                }}
              >
                ๊ฐ€์ž…ํ•˜๊ธฐ
              </Button>
              <Button
                className="signin_btn"
                color="btn"
                variant="contained"
                onClick={() => {
                  history.push("/signin");
                }}
              >
                ๋กœ๊ทธ์ธ
              </Button>
            </div>
          </div>
        </Route>

        <Route exact path="/join">
          <Join />
        </Route>
        <Route exact path="/signin">
          <Signin />
        </Route>
        </Switch>

    </ThemeProvider>
  );
}

export default App;

 

์ด๋ ‡๊ฒŒํ•˜๋ฉด /join์„ ํ†ตํ•ด์„œ join ํŽ˜์ด์ง€๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

 

3) Join ์ปดํฌ๋„ŒํŠธ ๋งŒ๋“ค๊ธฐ

์‚ฌ์‹ค ํšŒ์›๊ฐ€์ž… ํŽ˜์ด์ง€๋Š” ์ €๋ฒˆ์— ๋งŒ๋“  ๋กœ๊ทธ์ธ ํŽ˜์ด์ง€์™€ ๋ ˆ์ด์•„์›ƒ์ด ์™„์ „ํžˆ ๊ฐ™๋‹ค..!

 

ํšŒ์›๊ฐ€์ž… ํŽ˜์ด์ง€ / ๋กœ๊ทธ์ธ ํŽ˜์ด์ง€

 

๊ทธ๋ž˜์„œ ๋กœ๊ทธ์ธ ํŽ˜์ด์ง€์˜ ์ฝ”๋“œ๋ฅผ ๊ฐ€์ ธ๋‹ค๊ฐ€ ํ•˜๋‹จ์˜ ํ…์ŠคํŠธ๋งŒ ๋ณ€๊ฒฝํ•˜๋ฉด ๋œ๋‹ค.

์ €๋ฒˆ์— ๋งŒ๋“  Signin.js ํŽ˜์ด์ง€์˜ ์ฝ”๋“œ๋ฅผ ๊ทธ๋Œ€๋กœ ๊ฐ€์ง€๊ณ  ์˜จ๋‹ค (CSS๋„ ๋™์ผํ•˜๊ฒŒ ์ ์šฉํ•  ์ˆ˜ ์žˆ์Œ)

 

 

๊ทธ๋ฆฌ๊ณ  ํšŒ์›๊ฐ€์ž… ํŽ˜์ด์ง€์— ๋งž๊ฒŒ ํ…์ŠคํŠธ๋ฅผ ์ˆ˜์ •ํ•ด์ค€๋‹ค.

์ด์šฉ์•ฝ๊ด€๊ณผ ๊ฐœ์ธ์ •๋ณด ์ •์ฑ…์— Link ๋กœ ๋‹ค๋ฅธ ํŽ˜์ด์ง€์™€ ์—ฐ๊ฒฐ๋  ์ˆ˜ ์žˆ๋„๋ก ํ•œ๋‹ค. (๋‚˜์ค‘์— ๋งŒ๋“ค ํŽ˜์ด์ง€ ์ด๋ฆ„์ด text๋ผ text๋กœ ์—ฐ๊ฒฐ๋  ์ˆ˜ ์žˆ๋„๋ก ๋ฏธ๋ฆฌ ์ง€์ •)

 

import React from 'react';
import { useState } from "react";
import { useForm } from "react-hook-form";
import '../stylesheets/Signin.css';
import { TextField } from '@mui/material';
import { Link } from 'react-router-dom';

function Join(){

    const { register, handleSubmit } = useForm();
    const [result, setResult] = useState("");
    const onSubmit = (data) => setResult(JSON.stringify(data));
  

    return (
    <form onSubmit={handleSubmit(onSubmit)}>
    <TextField
    {...register("Email")} 
        id="standard-email-input"
        label="์ด๋ฉ”์ผ"
        type="email"
        autoComplete="current-email"
        variant="standard"
        helperText="Please enter Email"
        margin="dense"
        fullWidth 
      />
      <TextField
       {...register("Password")} 
        id="standard-password-input"
        label="๋น„๋ฐ€๋ฒˆํ˜ธ"
        type="password"
        autoComplete="current-password"
        variant="standard"
        helperText="Please enter Password"
        margin="dense"
        fullWidth 
      />
      <input className="join_btn" type="submit" value={"ํ™•์ธ"}/>
      <div className='join_txt'>
          <p>
          ๊ฐ€์ž…ํ•˜๋ฉด: <br />
          • ๋‹ค๋ฅธ ๊ธฐ๊ธฐ์—์„œ ๋กœ๊ทธ์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.<br />
          • ๋‹ค๋ฅธ ์‚ฌ์šฉ์ž๋“ค๊ณผ ํ•จ๊ป˜ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
          </p>
          <p>๊ฐ€์ž… ์‹œ ๋‹ค์Œ ์‚ฌํ•ญ์— ๋™์˜ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๊ฐ„์ฃผํ•ฉ๋‹ˆ๋‹ค. &nbsp;
          <Link to="/text" className='termOfUse'>์ด์šฉ์•ฝ๊ด€</Link>๊ณผ <Link className='policy' to="/text">๊ฐœ์ธ์ •๋ณด ์ •์ฑ…</Link>
          </p>
      </div>
      </form>)

}

export default Join;

 

 

 

์ด๋ ‡๊ฒŒ ํ•ด์ฃผ๋ฉด ํšŒ์›๊ฐ€์ž… ํŽ˜์ด์ง€๋„ ์™„์„ฑ!

ํšŒ์›๊ฐ€์ž… ๊ฐ„๋‹จํ•ด์„œ ์ข‹๋‹น!

 

 

 

 

 

 

 

 

 

* ์ถ”๊ฐ€๋กœ ํšŒ์˜ํ•  ์‚ฌํ•ญ ์ฐธ๊ณ  ์ž๋ฃŒ

 

 

[React] 5๋‹จ๊ณ„๋กœ ๋ณด๋Š” ๋ฆฌ์•กํŠธ ํด๋”๊ตฌ์กฐ

์ด ๊ธ€์€ ๋‹ค์Œ ๊ธ€์„ ๋ฒˆ์—ญํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค: React Folder Structure in 5 Steps React Folder Structure in 5 Steps - RWieruch How to structure large React apps into folders and files for a scalable React projec..

smoh.tistory.com

๋ฆฌ์•กํŠธ ํด๋”๋ฅผ ์กฐ๊ธˆ ๋” ์„ธ๋ถ„ํ™”ํ•ด์„œ 2๋ช…์ด ๋‚˜๋ˆ ์„œ ์—…๋ฌด๋ฅผ ๋ถ„๋ฐฐํ•  ์ˆ˜ ์žˆ๋„๋ก ๋งŒ๋“ค๊ธฐ..!

 

728x90