-
Notifications
You must be signed in to change notification settings - Fork 17
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: Added Form v2 support. #292
Conversation
a186272
to
99d167e
Compare
|
||
const Chip = styled.div<ChipProps>` | ||
border-radius: 100px; | ||
padding: ${({ isSubmitted }) => (isSubmitted ? 6 : 5)}px 16px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거는 혹시 왜 1px 사이즈가 달라지는걸까요?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isSubmitted 인 chip 은 보더가 없습니다 그래서 그만큼 패딩을 늘리는 트릭입니다. 애초에 border 를 안쓰고 shadow 를 쓰면 이럴필요없었는데 생각이 짧았네요. 나중에 리펙토링하겠습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uikit 뺄때 같이 작업
packages/uikit
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래 로직외에 추가로 enableFormTypeMessage && ~
를 disabled 에 추가해주어야 합니다.
export const isDisabledBecauseSuggestedReplies = (channel: GroupChannel | null | undefined, enableSuggestedReplies: boolean) => {
return enableSuggestedReplies && !!channel?.lastMessage?.extendedMessagePayload?.disable_chat_input;
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableFormTypeMessage 는 아직 위젯에서는 사용안하고 있습니다. 요거 추가한 이유가 나중에 위젯에서 uikit 으로 옮길때 필요해서입니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
참고로 위의 disabled 로직은 UIKit input 에 포함된 로직입니다. 위젯은 UIKit 의 input 을 사용하고 있습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 아직 enableFormTypeMessage 요게 uikit 에 추가 안되서 요건 나중에 해야 할것 같아요. 지금 위젯에서 enableSuggestedReplies: true 설정이 있어서 문제 없을것 같습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
placeholder string issue: Form -> Please choose one from above
🙅♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ 요거 배포 이후에 추가 작업 필요
6823320
to
2b16274
Compare
2b16274
to
a6e22f9
Compare
Size Change: +3.3 kB (+0.54%) Total Size: 617 kB
|
if (!item.isValid(values)) { | ||
return ErrorMessages.invalid; | ||
} | ||
if (!isSubmitted && required && values.length === 0) { | ||
return ErrorMessages.emptyRequired; | ||
} | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거에 따르면, 제출하지 않은 케이스에 대해서는 실시간으로 validate 하지 않는것 같은데
아래처럼 로직 바뀌어야 하나요?
if (isSubmitted) return null;
if (!item.isValid(values)) return ErrorMessages.invalid;
if (required && values.length === 0) return ErrorMessages.emptyRequired;
return null;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음 isSubmitted 면 onChange 가 호출이 안될거라 불필요해 보이긴 합니다 isSubmitted만 지우면 될것 같아요. 반영했습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
디자이너 분과 실제 예상동작 더블체크하기
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Hyungu Kang | Airen <[email protected]>
Ticket
CLNP-3932
Changelog
FormInput
ofFormMesage
now supports two newMessageFormItem.style.layout
types:chip
andtextarea
How to test?
chat-js
root, checkoutfeat/CLNP-3932-form-v2
branch. PRnpm run build
yarn dev
Dashboard
Updated UI
Updated UI
Figma link
https://www.figma.com/design/7XoO6XTg2hQvTM0wH3HDUk/2405_Forms_WIP?node-id=651-18703&m=dev