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

fix: button widths #4145

Merged
merged 3 commits into from
May 9, 2024
Merged

Conversation

tomoyuki28jp
Copy link
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #4133

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  1. Change your language to Japanese
  2. Go to the application list page ( http://localhost:3000/apps )
  3. Edit or delete from the menu in the lower right corner of an existing app.

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional I have added tests that prove my fix is effective or that my feature works
  • optional New and existing unit tests pass locally with my changes

Screenshots

スクリーンショット 2024-05-07 16 48 01
スクリーンショット 2024-05-07 16 48 07

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. ☕️ typescript Pull request that update TypeScript code. 🐞 bug Something isn't working labels May 7, 2024
@zxhlyh zxhlyh requested a review from JzoNgKVO May 7, 2024 07:57
@tomoyuki28jp tomoyuki28jp changed the title Fix button widths fix: button widths May 8, 2024
@TinsFox
Copy link
Contributor

TinsFox commented May 8, 2024

Hye @tomoyuki28jp

I have a small suggestion here. If you modify it like this, you will still have this problem when using this component in other places.

It is better to deal with it in its underlying components to obtain the effect once and for all. We can easily fix it by just adding whitespace-nowrap to this line

@apply inline-flex justify-center items-center content-center h-9 leading-5 rounded-lg px-4 py-2 text-base cursor-pointer;

The new code looks like this

 .btn {
    @apply inline-flex justify-center items-center content-center h-9 leading-5 rounded-lg px-4 py-2 text-base cursor-pointer whitespace-nowrap;
  }

@tomoyuki28jp
Copy link
Contributor Author

@TinsFox Thank you for your advice! I've also fixed the CSS styles.

zxhlyh
zxhlyh previously approved these changes May 9, 2024
@@ -42,8 +42,8 @@ const ConfirmUI: FC<IConfirmUIProps> = ({
</div>

<div className='flex gap-3 mt-4 ml-12'>
<Button type='primary' onClick={onConfirm} className='flex items-center justify-center w-20 text-center text-white rounded-lg cursor-pointer h-9 '>{confirmText || t('common.operation.confirm')}</Button>
<Button onClick={onCancel} className='flex items-center justify-center w-20 text-center text-gray-500 border rounded-lg cursor-pointer h-9 border-color-gray-200'>{cancelText || t('common.operation.cancel')}</Button>
<Button type='primary' onClick={onConfirm} className='flex items-center justify-center w-21 text-center text-white rounded-lg cursor-pointer h-9 '>{confirmText || t('common.operation.confirm')}</Button>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we can use min-w-20 to replace it?

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 9, 2024
@tomoyuki28jp
Copy link
Contributor Author

@zxhlyh Thank you for your review, I've updated my code to use min-w-20.

@zxhlyh zxhlyh self-requested a review May 9, 2024 04:51
Copy link
Collaborator

@zxhlyh zxhlyh left a comment

Choose a reason for hiding this comment

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

Thanks.

@zxhlyh zxhlyh merged commit a79941d into langgenius:main May 9, 2024
7 checks passed
evnydd0sf pushed a commit to evnydd0sf/dify that referenced this pull request May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files. ☕️ typescript Pull request that update TypeScript code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cancel buttons are too narrow in Japanese
3 participants