-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
357 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
'use client' | ||
|
||
import React, { useEffect } from 'react' | ||
// 'use client' | ||
import React from 'react' | ||
import { getTest } from '@/services/test/test' | ||
|
||
// async function getTestValue() { | ||
// const res = await getTest() | ||
// const data = await res.json() | ||
// return data | ||
// } | ||
async function getTestValue(): Promise<{ message: string } | null> { | ||
try { | ||
const res = await getTest() | ||
const data = await res.json() | ||
return data | ||
} catch (e) { | ||
console.log(e) | ||
return null | ||
} | ||
} | ||
|
||
export default function TestBlock() { | ||
// const data = await getTestValue() | ||
// console.log(data.message) | ||
export default async function TestBlock() { | ||
const data = await getTestValue() | ||
|
||
useEffect(() => { | ||
async function fetchData() { | ||
const data = await getTest() | ||
console.log(await data.json()) | ||
} | ||
fetchData() | ||
}, []) | ||
// useEffect(() => { | ||
// async function fetchData() { | ||
// const data = await getTest() | ||
// console.log(await data.json()) | ||
// } | ||
// fetchData() | ||
// }, []) | ||
|
||
return <div>{'index '}</div> | ||
return <div>{'index ' + data?.message}</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { | ||
Select, | ||
SelectContent, | ||
SelectGroup, | ||
SelectItem, | ||
SelectTrigger, | ||
SelectValue, | ||
} from './Select' | ||
|
||
const meta = { | ||
title: 'UI/Select', | ||
component: Select, | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
} satisfies Meta<typeof Select> | ||
|
||
export default meta | ||
type Story = StoryObj<typeof meta> | ||
|
||
export const Normal: Story = { | ||
args: {}, | ||
render: () => { | ||
return ( | ||
<Select> | ||
<SelectTrigger className="w-[180px]"> | ||
<SelectValue placeholder="Select a fruit" /> | ||
</SelectTrigger> | ||
<SelectContent> | ||
<SelectGroup> | ||
<SelectItem value="apple">Apple</SelectItem> | ||
<SelectItem value="banana">Banana</SelectItem> | ||
<SelectItem value="blueberry">Blueberry</SelectItem> | ||
<SelectItem value="grapes">Grapes</SelectItem> | ||
<SelectItem value="pineapple">Pineapple</SelectItem> | ||
</SelectGroup> | ||
</SelectContent> | ||
</Select> | ||
) | ||
}, | ||
} |
Oops, something went wrong.