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

feat: baan select component and BaanContext #50

Merged
merged 34 commits into from
Jul 17, 2024

Conversation

punchanabu
Copy link
Member

@punchanabu punchanabu commented Jul 12, 2024

BaanSelect Component

View mode

Empty State

  • ปุ่มเลือกบ้านยังไม่ได้เชื่อม
Screenshot 2567-07-14 at 13 57 01

View State

  • ปุ่มแก้ไขยังไม่ได้เชื่อม
Screenshot 2567-07-14 at 13 57 16

Edit mode

  • Can deleted selection by clicking trash icon
Screenshot 2567-07-14 at 13 58 25
  • กด confirmed จะมี pop up modal มา
Screenshot 2567-07-14 at 17 36 57
  • ถ้ากด confirmed แล้วจะแก้ไขอะไรไม่ได้แล้วใน edit mode ปุ่มแก้ไขจะหายทั้งหมด
Screenshot 2567-07-14 at 17 23 40

BaanContext

interface IBaanContext {
  baanCounts: BaanCount[] | null; 
  selectedBaan: BaanSelection[] | null; # อันนี้ไว้ดูบ้านที่เราเลือก
  addBaanSelection: (baanId: string, order: number) => void; # ไว้เลือกบ้าน
  removeBaanSelection: (baanId: string) => void; # ไว้ลบการเลือกบ้าน
  removeAllBaanSelection: () => void; #ไว้เคลียบ้านที่เลือกทั้งหมด
  isLoading: boolean;
}

Usage

const { selectedBaan } = useBaan()

@punchanabu punchanabu self-assigned this Jul 12, 2024
Copy link

vercel bot commented Jul 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
firstdate-rpkm67-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 17, 2024 2:30pm

@punchanabu punchanabu changed the title [WIP] feat: baan select component [WIP] feat: baan select component and BaanContext Jul 13, 2024
@punchanabu punchanabu changed the base branch from main to dev July 14, 2024 10:25
src/components/rpkm/Baan/BaanSelect.tsx Outdated Show resolved Hide resolved
src/components/rpkm/Baan/BaanSelect.tsx Outdated Show resolved Hide resolved
src/components/rpkm/Baan/BaanSelect.tsx Outdated Show resolved Hide resolved
src/components/rpkm/Baan/Section/BaanButtonsSection.tsx Outdated Show resolved Hide resolved
src/components/rpkm/Baan/Section/BaanButtonsSection.tsx Outdated Show resolved Hide resolved
src/components/rpkm/Baan/Section/BaanButtonsSection.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@TeeGoood TeeGoood left a comment

Choose a reason for hiding this comment

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

👍

@TeeGoood TeeGoood merged commit db7b863 into dev Jul 17, 2024
3 checks passed
@TeeGoood TeeGoood deleted the punpun-fe/fdr-71-baanselect-component branch July 17, 2024 14:37
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.

3 participants