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

User profile page for community #975

Merged
merged 2 commits into from
Oct 15, 2024
Merged

User profile page for community #975

merged 2 commits into from
Oct 15, 2024

Conversation

nighca
Copy link
Collaborator

@nighca nighca commented Oct 12, 2024

close #945

  • User profile page
  • Related APIs definition
  • Route utils redesign

Copy link

qiniu-prow bot commented Oct 12, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@nighca nighca changed the title Issue 945 User profile page for community Oct 12, 2024
Recommend to use together with [`useQuery`](@/utils/exception) hook.
-->

<script setup lang="ts" generic="T extends unknown[] | ByPage<unknown>">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

我最近在尝试对新增的 component 的内容采用 1) script 2) template 3) style 的顺序去组织,我是看到之前实训营的同学这么写过,我觉得挺合理的,考虑

  • 从逻辑上说 template 往往会依赖 script 中定义的变量、函数等,所以放在后边合理一些
  • style 的编写经常对应 template 中的 class name 和 HTML 结构,这俩靠得近些会更方便

Copy link
Member

Choose a reason for hiding this comment

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

component 的内容采用 1) script 2) template 3) style 的顺序去组织

https://vuejs.org/style-guide/rules-recommended.html#single-file-component-top-level-element-order

嗯 vue 官方推荐里虽然没有写明,但 examples 里基本都是这种顺序,明显是更偏好这种

@nighca nighca marked this pull request as ready for review October 14, 2024 02:15
@qiniu-ci
Copy link

This PR has been deployed to the preview environment. You can explore it using the preview URL.

Warning

Please note that deployments in the preview environment are temporary and will be automatically cleaned up after a certain period. Make sure to explore it before it is removed. For any questions, contact the Go+ Builder team.

<template #title>
{{
$t({
// TODO: "my" or "your"? (consistency)
Copy link
Member

Choose a reason for hiding this comment

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

关于【第一人称 vs 第二人称】的问题,我很久以前也和别人讨论过,但发现并没有“最佳选择”,最终我们是参考了竞品 No.1 的风格😂

感觉其实只要在自己的产品中保持风格一致就够了,苹果和谷歌的设计指南里也差不多是这么说的

Copy link
Collaborator Author

@nighca nighca Oct 14, 2024

Choose a reason for hiding this comment

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

是的,做到这里的时候发现原型图上的人称是不一致的(主要是首页跟 user profile 页),要统一的话不少文案可能要重新想一下,所以先记个 TODO

目前计划是统一为第二人称,这样在 home 页就是“your ...”,而在 user profile 页就是“my ...”

<div>Followers</div>
<UserContent class="user-likes">
<template #title>
{{ $t({ en: 'Followers', zh: '被关注' }) }}
Copy link
Member

Choose a reason for hiding this comment

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

感觉把 Followers 翻译成被关注有点奇怪,叫粉丝或者关注者追随者会不会更好?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

嗯现在的“被关注”跟“关注”比较生硬,我跟着上边提到的人称一起调整下

Copy link
Member

Choose a reason for hiding this comment

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

好的,那先 approve

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK

<div>Following</div>
<UserContent class="user-likes">
<template #title>
{{ $t({ en: 'Following', zh: '关注' }) }}
Copy link
Member

Choose a reason for hiding this comment

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

关注是个动词了不太合适吧?正在关注好一些

@nighca nighca merged commit 1582347 into goplus:dev Oct 15, 2024
4 checks passed
@nighca nighca mentioned this pull request Oct 15, 2024
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.

Community User Profile Page
3 participants