linagora / Twake

Twake is a secure open source collaboration platform to improve organizational productivity.
https://twake.app
GNU Affero General Public License v3.0
1.79k stars 195 forks source link

Build the channel, user, workspaces and companies molecule and atoms #2341

Closed RomaricMourgues closed 2 years ago

RomaricMourgues commented 2 years ago

The channel molecule is used in the new channel bar, in the search results and in some titles, the workspace and companies molecules are almost the same so I propose to create them in the same time.

In context examples:

There is workspaces (squarish) companies, with one title or one title and a subtitle, different width, two sizes and different suffixes.

Screenshot 2022-06-22 at 09.23.35.png

Screenshot 2022-06-22 at 09.23.44.png

Screenshot 2022-06-22 at 09.23.53.png

Screenshot 2022-06-22 at 09.24.03.png

More details:

Atoms (we have 2)

Molecules (we have 4)

We'll have 4 molecules that are the channel, the user, the workspace and the company.

They will use the following atoms: Avatar (freshly created), the Text.Title and the Text.Base. It will take the following props: title (ReactNode), avatar, size, subtitle (ReactNode).

We can get the title text (in case of react node) like this: https://stackoverflow.com/questions/50428910/get-text-content-from-node-in-react or we can create a new props like avatarTitle.

For workspaces and companies and users, we will add a props suffix which will contain a ReactNode vertically aligned with everything else.

For channels, we will add a props date (for the date top right when it should be displayed) and suffix (for the mention badge or the notifications badge, /!\ in the channel case the alignment is with the subtitle).

Interactions

There is no interactions for this molecules, nor business logic. It will be managed by the parent.

Dark mode

The colors are managed by the Text atoms mainly, only the grey of the subtitle is set but it is a medium grey that is dark mode ok.

Notes

RomaricMourgues commented 2 years ago

@romanesko ready to go for this one, both molecules and atoms should be available on the storybook