Skip to content

Commit

Permalink
Merge pull request #2 from whatever-mentoring/feature/design-system-c…
Browse files Browse the repository at this point in the history
…omponents

Feature/design system components
  • Loading branch information
asaei623 authored Sep 13, 2023
2 parents 4c7af9b + f9185a5 commit 980dd1b
Show file tree
Hide file tree
Showing 23 changed files with 320 additions and 102 deletions.
14 changes: 14 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const { CracoAliasPlugin } = require("react-app-alias");

module.exports = {
plugins: [
{
plugin: CracoAliasPlugin,
options: {
source: "tsconfig",
baseUrl: ".",
tsConfigPath: "./tsconfig.paths.json",
},
},
],
};
3 changes: 3 additions & 0 deletions custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module '*.woff2';
declare module '*.png';
declare module '*.svg';
1 change: 0 additions & 1 deletion fonts.d.ts

This file was deleted.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@craco/craco": "^7.1.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/node": "^20.5.9",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@types/styled-components": "^5.1.26",
"polished": "^4.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
Expand All @@ -18,10 +21,10 @@
"web-vitals": "^2.1.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "craco eject"
},
"eslintConfig": {
"extends": [
Expand All @@ -42,6 +45,7 @@
]
},
"devDependencies": {
"react-app-alias": "^2.2.2",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11"
}
}
7 changes: 1 addition & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import DesignTest from "DesignTest";
import React from "react";

function App() {
return (
<div>
<DesignTest />
</div>
);
return <div></div>;
}

export default App;
67 changes: 0 additions & 67 deletions src/DesignTest.tsx

This file was deleted.

5 changes: 5 additions & 0 deletions src/assets/icons/answer-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/assets/icons/answer-on.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/icons/ask-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/icons/ask-on.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/icons/juicygeul-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/icons/juicygeul-on-cyni.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/icons/juicygeul-on-juni.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/icons/mypage-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/icons/mypage-on-cyni.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/icons/mypage-on-juni.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions src/components/Category.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import styled from 'styled-components';
import { Palette } from 'styles/Palette';
import Typo from 'styles/Typo';

interface propsType {
id: number;
name: string;
selected: boolean;
onClick: (id: number) => void;
}
interface containerProps {
selected: boolean;
}

const Category = ({ id, name, selected, onClick }: propsType) => {
return (
<Container selected={selected} onClick={() => onClick(id)}>
<Typo.b3>{name}</Typo.b3>
</Container>
);
};

export default Category;

const Container = styled.div<containerProps>`
display: inline-flex;
justify-content: center;
align-items: center;
padding: 3px 10px;
border-radius: 30px;
cursor: pointer;
${(props) =>
props.selected
? `
border : 1.5px solid ${Palette.Main};
background: ${Palette.Main15};
color : ${Palette.Main};
`
: `
border : 0.75px solid ${Palette.Black};
background: ${Palette.White};
color : ${Palette.Black};
`};
`;
Loading

0 comments on commit 980dd1b

Please sign in to comment.