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

Chore: Change bundle tags color and refactor app details page header styles #27293

Merged
merged 25 commits into from Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
216ae6e
style: :lipstick: Refactor app details page header style
rique223 Nov 17, 2022
206de92
change Tag variant to 'enterprise'
felipe-rod123 Dec 5, 2022
625e78f
Merge branch 'develop' into chore/app-metadata-typography-marketplace
felipe-rod123 Dec 9, 2022
64bbbec
fix imports
felipe-rod123 Dec 9, 2022
2ecfa79
fix 'featured' variant and conflicts
felipe-rod123 Dec 14, 2022
ff54978
fix lint
felipe-rod123 Dec 15, 2022
7508d49
Merge remote-tracking branch 'origin' into chore/app-metadata-typogra…
rique223 Jan 9, 2023
e3fb0d7
Merge branch 'develop' into chore/app-metadata-typography-marketplace
rique223 Jan 9, 2023
a59a531
Merge branch 'develop' into chore/app-metadata-typography-marketplace
rique223 Jan 9, 2023
f204458
Refactor unnecessary code for enterprise tag tooltip
rique223 Jan 10, 2023
62c226a
Merge branch 'develop' into chore/app-metadata-typography-marketplace
rique223 Jan 10, 2023
b6fd6bb
style: :lipstick: Remove unnecessary AppMenu margin
rique223 Jan 10, 2023
c07ed21
Merge branch 'chore/app-metadata-typography-marketplace' of github.co…
rique223 Jan 10, 2023
9c78c32
review
juliajforesti Jan 10, 2023
26b6de3
Merge branch 'chore/app-metadata-typography-marketplace' of github.co…
juliajforesti Jan 10, 2023
6dbc6b9
remove mis from AppStatus to align with other elements
juliajforesti Jan 10, 2023
78aa6eb
replace Button custom styling with small variant
juliajforesti Jan 10, 2023
345228d
Remove unnecessary ref from BundleChips component
rique223 Jan 11, 2023
c881653
Reviews
rique223 Jan 13, 2023
5090b45
chore: margins
dougfabris Jan 13, 2023
e216323
fix: :bug: Remove duplicated app version from AppDetailsPageHeader
rique223 Jan 13, 2023
87e921d
Merge branch 'chore/app-metadata-typography-marketplace' of github.co…
rique223 Jan 13, 2023
6d34dd7
Merge branch 'develop' into chore/app-metadata-typography-marketplace
rique223 Jan 13, 2023
79fd6c9
chore: divider
dougfabris Jan 13, 2023
5189862
Merge branch 'develop' into chore/app-metadata-typography-marketplace
kodiakhq[bot] Jan 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 3 additions & 11 deletions apps/meteor/client/components/avatar/AppAvatar.tsx
@@ -1,22 +1,14 @@
import { Box } from '@rocket.chat/fuselage';
import type { ReactElement } from 'react';
import type { ComponentProps, ReactElement } from 'react';
import React from 'react';

import BaseAvatar from './BaseAvatar';

// TODO: frontend chapter day - Remove inline Styling

type AppAvatarProps = {
/* @deprecated */
size: 'x36' | 'x28' | 'x16' | 'x40' | 'x124';
/* @deprecated */
mie?: 'x80' | 'x20' | 'x16' | 'x8';
/* @deprecated */
alignSelf?: 'center';

iconFileContent: string;
iconFileData: string;
};
size: ComponentProps<typeof BaseAvatar>['size'];
} & ComponentProps<typeof Box>;

export default function AppAvatar({ iconFileContent, size, iconFileData, ...props }: AppAvatarProps): ReactElement {
return (
Expand Down
Expand Up @@ -22,7 +22,20 @@ const versioni18nKey = (app: App): string => {

const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => {
const t = useTranslation();
const { iconFileData, name, author, iconFileContent, installed, modifiedAt, bundledIn, versionIncompatible, isSubscribed } = app;
const {
iconFileData,
name,
author,
version,
iconFileContent,
installed,
modifiedAt,
bundledIn,
versionIncompatible,
isSubscribed,
shortDescription,
} = app;

const lastUpdated = modifiedAt && moment(modifiedAt).fromNow();
const incompatibleStatus = versionIncompatible ? appIncompatibleStatusProps() : undefined;

Expand All @@ -36,16 +49,41 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => {
</Box>
{bundledIn && Boolean(bundledIn.length) && <BundleChips bundledIn={bundledIn} />}
</Box>
{app?.shortDescription && <Box mbe='x16'>{app.shortDescription}</Box>}

{shortDescription && (
<Box fontScale='p1' color='default' mbe='x16'>
rique223 marked this conversation as resolved.
Show resolved Hide resolved
{shortDescription}
</Box>
)}

<Box display='flex' flexDirection='row' alignItems='center' mbe='x16'>
<AppStatus app={app} installed={installed} isAppDetailsPage />
{(installed || isSubscribed) && <AppMenu app={app} isAppDetailsPage mis='x8' />}
</Box>
<Box display='flex' flexDirection='row' color='hint' alignItems='center'>
<Box fontScale='p2m' mie='x16'>
{t('By_author', { author: author?.name })}
<Box fontScale='c1' mie='x16'>
{author?.name}
</Box>
<Box fontScale='c1' color='stroke-light'>
|
</Box>
<Box fontScale='c1' mi='x16'>
{t('Version_version', { version })}
</Box>

{lastUpdated && (
<>
<Box fontScale='c1' color='stroke-light'>
rique223 marked this conversation as resolved.
Show resolved Hide resolved
|
</Box>
<Box fontScale='c1' mis='x16'>
{t('Marketplace_app_last_updated', {
lastUpdated,
})}
</Box>
</>
)}

<Box is='span'> | </Box>

<Box mi='x16' marginInlineEnd='x4'>
Expand All @@ -62,17 +100,6 @@ const AppDetailsPageHeader = ({ app }: { app: App }): ReactElement => {
</Tag>
</Box>
)}

{lastUpdated && (
<>
<Box is='span'> | </Box>
<Box mi='x16'>
{t('Marketplace_app_last_updated', {
lastUpdated,
})}
</Box>
</>
)}
</Box>
</Box>
</Box>
Expand Down
37 changes: 23 additions & 14 deletions apps/meteor/client/views/admin/apps/BundleChips.tsx
@@ -1,7 +1,7 @@
import { Tag } from '@rocket.chat/fuselage';
import { Box, PositionAnimated, Tag, Tooltip, AnimatedVisibility } from '@rocket.chat/fuselage';
import { useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React from 'react';
import type { ReactElement, RefObject } from 'react';
import React, { Fragment, useRef, useState } from 'react';

import type { App } from './types';

Expand All @@ -15,19 +15,28 @@ type BundleChipsProps = {

const BundleChips = ({ bundledIn }: BundleChipsProps): ReactElement => {
const t = useTranslation();

const bundleRef = useRef<Element>();
const [isHovered, setIsHovered] = useState(false);
return (
<>
{bundledIn.map((bundle, index) => (
<Tag
key={index}
title={t('this_app_is_included_with_subscription', {
bundleName: bundle.bundleName,
})}
variant='primary'
>
{bundle.bundleName}
</Tag>
{bundledIn.map((bundle) => (
<Fragment key={bundle.bundleId}>
rique223 marked this conversation as resolved.
Show resolved Hide resolved
<Box ref={bundleRef} onMouseEnter={(): void => setIsHovered(true)} onMouseLeave={(): void => setIsHovered(false)}>
<Tag variant='featured'>{bundle.bundleName}</Tag>
</Box>
<PositionAnimated
rique223 marked this conversation as resolved.
Show resolved Hide resolved
anchor={bundleRef as RefObject<Element>}
placement='top-middle'
margin={8}
visible={isHovered ? AnimatedVisibility.VISIBLE : AnimatedVisibility.HIDDEN}
>
<Tooltip>
{t('this_app_is_included_with_subscription', {
bundleName: bundle.bundleName,
})}
</Tooltip>
</PositionAnimated>
</Fragment>
))}
</>
);
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Expand Up @@ -776,7 +776,6 @@
"Buy": "Buy",
"By": "By",
"by": "by",
"By_author": "By __author__",
"cache_cleared": "Cache cleared",
"Call": "Call",
"Call_back": "Call back",
Expand Down