Skip to content

Commit

Permalink
Merge pull request #61 from GlowTales/feat/#47
Browse files Browse the repository at this point in the history
[CHORE] 스토리북 파일 확장자명 변경 및 불필요한 코드 제거
  • Loading branch information
gominzip authored Aug 27, 2024
2 parents 260cf04 + 168b1e7 commit f5f63d8
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 51 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ GlowTales-Client
┣ public
┣ src
┃ ┣ apis
┃ ┣ assets
┃ ┣ components
┃ ┃ ┣ common
┃ ┃ ┣ learn
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"react-icons": "^5.3.0",
"react-responsive": "^10.0.0",
"react-router-dom": "^6.26.1",
"styled-components": "^6.1.12",
"zustand": "^4.5.5"
"styled-components": "^6.1.12"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.6.1",
Expand Down
5 changes: 0 additions & 5 deletions src/apis/authAxois.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ export const getAuthAxios = (token: string | null) => {
},
async (error) => {
throw error;
// alert("토큰이 만료되었습니다. 재로그인 후 시도해주세요!");
// LocalStorage.removeItem("access");
// LocalStorage.removeItem("refresh");
// window.location.href = "/login";
// return Promise.reject(error); // 에러 전달
}
);

Expand Down
1 change: 0 additions & 1 deletion src/apis/createTales.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import LocalStorage from "@utils/localStorage";
import { getAuthAxios } from "./authAxois";
import { CreateTaleData } from "@type/createTale";
// import { Server } from "./settings";

const baseURL = import.meta.env.VITE_PUBLIC_SERVER_URL;

Expand Down
25 changes: 0 additions & 25 deletions src/apis/settings.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/assets/react.svg

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/learn/TaleLearn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const TaleLearn = ({ quizData }: TaleLearnProps) => {
const postResult = async (languageTaleId: number, answerCounts: number) => {
try {
const response = await postAnswerCount(languageTaleId, answerCounts);
console.log(response);
return response.data
} catch (error) {
console.error("Error fetching data:", error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ const HomeRecentTales = () => {
chunkedTales.push(sliceTales.slice(i, i + 3));
}

const goRead = (response: CardProps) => {
navigate(`/readTale`, { state: { response } });
};

const handleMoreClick = () => {
navigate("/home/moreRecentTales", { state: { allTales: tales } });
};
Expand All @@ -57,7 +53,6 @@ const HomeRecentTales = () => {
title={tale.title}
createdAt={tale.createdAt}
languageTaleId={tale.taleId}
readFunction={() => goRead(tale)}
/>
{(index + 1) % 2 === 0 && index !== sliceTales.length - 1 && (
<Shelf src="/shelf.png" key={`shelf-${index}`} />
Expand Down
2 changes: 0 additions & 2 deletions src/pages/TaleLearnPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const TaleLearnPage = () => {
const location = useLocation();
const id = location.state || {};

console.log(id);

useEffect(() => {
const getQuiz = async (taleId: number) => {
const response = await getQuizAndAnswer(taleId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ import { nationElements } from "@utils/defaultData";
const meta: Meta<DropdownProps> = {
title: "Components/Dropdown",
component: Dropdown,
decorators: [
(Story) => (
<div style={{ width: '100%',display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Story />
</div>
),
],
parameters: {
layout: "fullscreen",
docs: {
Expand Down Expand Up @@ -58,15 +65,15 @@ export default meta;

type Story = StoryObj<typeof meta>;

export const SelecOption: Story = {
export const SelectOption: Story = {
args: {
selectList: [
{ text: "옵션1", value: 1 },
{ text: "옵션2", value: 2 },
],
},
};
export const SelecOptionWithImg: Story = {
export const SelectOptionWithImg: Story = {
args: {
selectList: nationElements,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import { Meta, StoryObj } from "@storybook/react";
const meta: Meta<ProgressBarProps> = {
title: "Components/ProgressBar",
component: ProgressBar,
decorators: [
(Story) => (
<div style={{ width: '100%',display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Story />
</div>
),
],
parameters: {
layout: "fullscreen",
docs: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import { fn } from "@storybook/test";
const meta: Meta<SelectListProps> = {
title: "Components/SelectOptionList",
component: SelectOptionList,
decorators: [
(Story) => (
<div style={{ width: '100%',display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Story />
</div>
),
],
parameters: {
layout: "fullscreen",
docs: {
Expand Down
3 changes: 0 additions & 3 deletions src/type/card.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ export interface CardProps {
createdAt: string;
btnText?: string;
firstQuizCount?: number;
readFunction?: () => void;
unLearnedFunction?: () => void;
learnFunction?: () => void;
}

export interface WordProps {
Expand Down
6 changes: 3 additions & 3 deletions src/type/dropdown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface DropdownProps {
}

export interface DropdownElement {
imgURL?: string; // 앞에 로고 들어가야 하는 경우 경로 넣기
text: string; // 드랍다운에 작성될 텍스트
value: string | number | null; // 실제 들어갈 값
imgURL?: string;
text: string;
value: string | number | null;
}

0 comments on commit f5f63d8

Please sign in to comment.