๐Ÿ”ฅ Today


  • ํฌํŠธํด๋ฆฌ์˜ค๋ฅผ ๋งŒ๋“ค๋ฉด์„œ Material-UI๋ฅผ ์ฒ˜์Œ ์‚ฌ์šฉํ•ด๋ดค๋‹ค. ํ”„๋กœ์ ํŠธ์— ํ•„์š”ํ•œ ์•„์ด์ฝ˜์ด๋‚˜ ํ…œํ”Œ๋ฆฟ์ด ๋‹ค์–‘ํ•˜๊ฒŒ ๋งŽ์ด ์žˆ์–ด์„œ ์ข…์ข… ์‚ฌ์šฉํ•˜๊ฒŒ ๋  ๊ฒƒ ๊ฐ™๋‹ค. ์ด๋ฒˆ์—๋Š” ํฌํŠธํด๋ฆฌ์˜ค์— ๋“ค์–ด๊ฐ€๋Š” toggle button์„ ๋งŒ๋“ค์–ด ๋ผ์ดํŠธ๋ชจ๋“œ์™€ ๋‹คํฌ๋ชจ๋“œ๋ฅผ ๋งŒ๋“ค์–ด๋ณด๋ ค ํ•œ๋‹ค. ์šฐ์„  Material-UI ํ”„๋ ˆ์ž„์›Œํฌ๋กœ toggle ์•ก์…˜์ด ๋˜๋Š” ๋ฒ„ํŠผ์„ ์ปค์Šคํ…€ํ•˜์—ฌ ๋งŒ๋“ค์–ด๋’€๋‹ค.
import React, { useState } from "react";
import { withStyles } from "@material-ui/core/styles";
import FormControlLabel from "@material-ui/core/FormControlLabel";
import Switch from "@material-ui/core/Switch";

const OrangeSwitch = withStyles({
  root: {
    width: "60px",
    height: "40px",
  },
  switchBase: {
    color: "#F54404",
    "&$checked": {
      color: "#F54404",
    },
    "&$checked + $track": {
      backgroundColor: "#F54404",
    },

    "&$focusVisible $thumb": {
      border: "6px solid #F54404",
    },
  },
  track: {
    border: `1px solid black`,
    backgroundColor: "white",
  },
  checked: {},
})(Switch);

export default function CustomizedSwitches() {
  const [isChecked, setIsChecked] = useState(false);

  const handleChange = () => {
    setIsChecked(!isChecked);
  };

  return (
    <div>
      <FormControlLabel
        control={
          <OrangeSwitch
            checked={isChecked}
            onChange={handleChange}
            name="checkedA"
          />
        }
        label="change the color!"
      />
    </div>
  );
}


๐Ÿ”ฅ To Do


  • [๋ถ€์ŠคํŠธ์ฝ”์Šค] project B
  • [Algorithm] javaScript ๋งค์ผ 1๋ฌธ์ œ ์ด์ƒ ํ’€๊ธฐ
  • [๋ถ€์ŠคํŠธ์ฝ”์Šค] CS ์ž๋ฃŒ๊ตฌ์กฐ, ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ฐ•์˜