-
Notifications
You must be signed in to change notification settings - Fork 34
Fix: dispute dialog #180
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
Open
Fengfeng2010
wants to merge
3
commits into
linux-do:master
Choose a base branch
from
Fengfeng2010:fix-dispute-dialog
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix: dispute dialog #180
+64
−8
Conversation
This file contains hidden or 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
Contributor
Author
Contributor
Author
Contributor
export function ViewDisputeHistoryDialog({ order }: { order: Order }) {
// ...
const disputeConfig = useMemo(() => {
switch (order.status) {
case 'refused':
return {
tooltip: '争议已拒绝,点击查看',
timelineText: '服务方驳回争议',
timelineColor: 'destructive',
showTimestamp: true,
showContent: false,
content: null
}
case 'refund':
return {
tooltip: '争议已退款',
timelineText: '服务方已退款',
timelineColor: 'primary',
showTimestamp: true,
showContent: true,
content: '退款已完成'
}
case 'disputing':
return {
tooltip: '争议处理中,点击查看',
timelineText: '争议进行中',
timelineColor: 'primary',
showTimestamp: false,
showContent: false,
content: null
}
default:
return {
tooltip: '未知状态',
timelineText: '未知状态',
timelineColor: 'primary',
showTimestamp: false,
showContent: false,
content: null
}
}
}, [order.status])
return (
<>
<Tooltip>
<TooltipTrigger asChild>
{/* ... */}
</TooltipTrigger>
<TooltipContent side="top">
<p>{disputeConfig.tooltip}</p>
</TooltipContent>
</Tooltip>
<Dialog open={open} onOpenChange={handleOpenChange}>
{/* ... */}
<div className="relative">
<div className={`absolute -left-[21px] top-1 h-2.5 w-2.5 rounded-full
${disputeConfig.timelineColor === 'destructive' ? 'bg-destructive' : 'bg-primary'}
ring-4 ring-background`}
/>
<div className="space-y-1">
<div className="flex items-center justify-between">
<span className={`text-sm font-medium ${disputeConfig.timelineColor === 'destructive' ? 'text-destructive' : ''}`}>
{disputeConfig.timelineText}
</span>
{disputeConfig.showTimestamp && (
<span className="text-xs text-muted-foreground">
{formatDateTime(disputeHistory.updated_at)}
</span>
)}
</div>
{order.status === 'refused' && (
<div className="text-sm text-muted-foreground bg-destructive/5 border border-destructive/10 p-3 rounded-md">
{parseDisputeReason(disputeHistory.reason).merchantReason || "未提供拒绝理由"}
</div>
)}
{disputeConfig.showContent && disputeConfig.content && (
<div className="text-sm text-muted-foreground bg-muted/50 p-3 rounded-md">
{disputeConfig.content}
</div>
)}
</div>
</div>
</Dialog>
</>
)
}猫猫看了一下,好像把语言合并一下这样更好欸 owo |
Contributor
Author
|
看不懂qwq |
Contributor
|
改成像这样就行了喵 owo @Fengfeng2010 |
f80f0f9 to
4e3d9b6
Compare
Contributor
Author
|
62ed2e2 w? |
4e3d9b6 to
bfb2173
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
例行检查
关联信息
fix: #181