-
Notifications
You must be signed in to change notification settings - Fork 273
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
refactor(notify): [notify] refactor notify theme #2311
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
de89d02
refactor(notify): fix demos
shenjunjian de91b4d
fix(notify): fix demos
shenjunjian a6f39a2
refactor(notify): refactor notify's theme
shenjunjian ae05f68
fix(notify): fix demos and docs
shenjunjian 88f535d
fix(notify): fix
shenjunjian 6ea33e4
fix(notify): fix
shenjunjian c0484d1
fix(notify): fix e2e test
shenjunjian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
18 changes: 0 additions & 18 deletions
18
examples/sites/demos/pc/app/notify/message-composition-api.vue
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
30 changes: 16 additions & 14 deletions
30
examples/sites/demos/pc/app/notify/position-composition-api.vue
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,26 +1,28 @@ | ||
<template> | ||
<div class="content"> | ||
<tiny-button @click="infoClick" :reset-time="0">默认 bottom-right</tiny-button> | ||
<tiny-button @click="successClick" :reset-time="0">top-right</tiny-button> | ||
<tiny-button @click="handleClick('top-left')" :reset-time="0">top-left</tiny-button> | ||
<tiny-button @click="handleClick('top-right')" :reset-time="0">top-right</tiny-button> | ||
<br /> | ||
<br /> | ||
<tiny-button @click="handleClick('bottom-left')" :reset-time="0">bottom-left</tiny-button> | ||
<tiny-button @click="handleClick('bottom-right')" :reset-time="0">bottom-right</tiny-button> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="jsx"> | ||
<script setup> | ||
import { Notify, Button as TinyButton } from '@opentiny/vue' | ||
|
||
function infoClick() { | ||
function handleClick(pos) { | ||
Notify({ | ||
type: 'info', | ||
title: (h, params) => <h4>通知消息的标题</h4>, | ||
message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文' | ||
}) | ||
} | ||
|
||
function successClick() { | ||
Notify({ | ||
type: 'success', | ||
title: '通知消息的标题', | ||
message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', | ||
position: 'top-right' | ||
position: pos | ||
}) | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.tiny-button { | ||
min-width: 120px; | ||
} | ||
</style> |
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 |
---|---|---|
@@ -1,32 +1,35 @@ | ||
<template> | ||
<div class="content"> | ||
<tiny-button @click="infoClick" :reset-time="0">默认 bottom-right</tiny-button> | ||
<tiny-button @click="successClick" :reset-time="0">top-right</tiny-button> | ||
<tiny-button @click="handleClick('top-left')" :reset-time="0">top-left</tiny-button> | ||
<tiny-button @click="handleClick('top-right')" :reset-time="0">top-right</tiny-button> | ||
<br /> | ||
<br /> | ||
<tiny-button @click="handleClick('bottom-left')" :reset-time="0">bottom-left</tiny-button> | ||
<tiny-button @click="handleClick('bottom-right')" :reset-time="0">bottom-right</tiny-button> | ||
</div> | ||
</template> | ||
|
||
<script lang="jsx"> | ||
<script> | ||
import { Notify, Button } from '@opentiny/vue' | ||
|
||
export default { | ||
components: { | ||
TinyButton: Button | ||
}, | ||
methods: { | ||
infoClick() { | ||
handleClick(pos) { | ||
Notify({ | ||
type: 'info', | ||
title: (h, params) => <h4>通知消息的标题</h4>, | ||
message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文' | ||
}) | ||
}, | ||
successClick() { | ||
Notify({ | ||
type: 'success', | ||
title: '通知消息的标题', | ||
message: '通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文,通知消息的正文', | ||
position: 'top-right' | ||
position: pos | ||
}) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.tiny-button { | ||
min-width: 120px; | ||
} | ||
</style> |
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
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
18 changes: 0 additions & 18 deletions
18
examples/sites/demos/pc/app/notify/title-composition-api.vue
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
💡 Codebase verification
Issues Found: Multiple instances of
Notify
still use thetype
property and dynamic JSX fortitle
. Please review these usages to ensure consistency and prevent potential issues.🔗 Analysis chain
LGTM! Please clarify changes to title and notification type.
The script changes look good overall. The consolidation of notification handling into a single
handleClick
method improves code organization and maintainability.I have a couple of questions:
type
property has been removed from theNotify
call. How does this affect the appearance or behavior of the notifications?To help verify the impact of these changes, could you run the following script?
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 119
Script:
Length of output: 66
Script:
Length of output: 95098