Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(admin): supabase 연결 및 설문 생성 로직 작성 #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Ssoon-m
Copy link
Collaborator

@Ssoon-m Ssoon-m commented Feb 29, 2024

작업한 내용

  • provider를 이용하여 supabase를 주입해서 사용
  • 설문 생성을 위한 임시 데이터 형식 생성 후 테스트

@Ssoon-m Ssoon-m changed the title [feature] supabase 연결 및 설문 생성 로직 작성 feature(admin): supabase 연결 및 설문 생성 로직 작성 Feb 29, 2024
Copy link

@kickbelldev kickbelldev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모노레포로 구성하신거 좋네요

@@ -47,5 +47,12 @@
}
}
},
"nxCloudAccessToken": "ZjgyN2VmY2EtZjljMy00NGNiLTllMGUtMWI3OGQ2ZDAxN2M3fHJlYWQtd3JpdGU="
"nxCloudAccessToken": "ZjgyN2VmY2EtZjljMy00NGNiLTllMGUtMWI3OGQ2ZDAxN2M3fHJlYWQtd3JpdGU=",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요 토큰은 노출되어도 괜찮은가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export const SupabaseContext = createContext<SupabaseContextValue | null>(null);
SupabaseContext.displayName = 'SupabaseContext';

export const SupabaseProvider = ({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supabase를 컨텍스트로 묶으신 이유가 있을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

web,admin 프로젝트에서 supabase 인스턴스 얻는 코드를 공통으로 사용하고 싶어서 묶었습니다!

return <div>Admin!!</div>;
const mutate = useCreateSurvey();

const onMutateSurvey = () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p4: 직접 연결되는 컴포넌트 네이밍은 handle-
props로 넘길때는 on- 각각 접두사를 사용하면 이후 명확하게 알 수 있어요

https://youngmin.hashnode.dev/react-1

hasOption: boolean;
}[] = [];

sectionIds.forEach((id, i) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3: forEach가 아니라 map으로 함수를 반환하게 사용할 수 없을까요? 사소하지만 함수형으로 사용하도록 노력하면 명시적으로 작성할 수 있을 것 같아요

@@ -8,6 +9,8 @@ const root = ReactDOM.createRoot(
);
root.render(
<StrictMode>
<App />
<SupabaseProvider supabaseKey={import.meta.env.VITE_SUPABASE_KEY}>
<App />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p3: 가장 최상단에서 ErrorBoundary로 묶어서 처리하면 이후 에러가 전파되는 상황에서 에러를 처리하기가 좋습니닷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants