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

Add privacy icon to space blocks #7171

Merged
merged 5 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/i18n/ach/translation.ach.json
Original file line number Diff line number Diff line change
Expand Up @@ -2684,8 +2684,8 @@
},
"operations": {
"user-group": {
"updated-successfuly": "crwdns10706:0{{name}}crwdne10706:0",
"deleted-successfuly": "crwdns10708:0{{name}}crwdne10708:0"
"updated-successfully": "crwdns10706:0{{name}}crwdne10706:0",
"deleted-successfully": "crwdns10708:0{{name}}crwdne10708:0"
}
},
"kratos": {
Expand Down
4 changes: 2 additions & 2 deletions src/core/i18n/bg/translation.bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2675,8 +2675,8 @@
},
"operations": {
"user-group": {
"updated-successfuly": "Групата {{name}} е обновена!",
"deleted-successfuly": "Групата {{name}} е изтрита успешно"
"updated-successfully": "Групата {{name}} е обновена!",
"deleted-successfully": "Групата {{name}} е изтрита успешно"
}
},
"kratos": {
Expand Down
4 changes: 2 additions & 2 deletions src/core/i18n/de/translation.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2675,8 +2675,8 @@
},
"operations": {
"user-group": {
"updated-successfuly": "Die Gruppe %name% wurde aktuallisiert!",
"deleted-successfuly": "Die Gruppe wurde erfolgreich gelöscht"
"updated-successfully": "Die Gruppe %name% wurde aktuallisiert!",
"deleted-successfully": "Die Gruppe wurde erfolgreich gelöscht"
}
},
"kratos": {
Expand Down
6 changes: 3 additions & 3 deletions src/core/i18n/en/translation.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2764,8 +2764,8 @@
},
"operations": {
"user-group": {
"updated-successfuly": "Group {{name}} has been updated!",
"deleted-successfuly": "Group {{name}} deleted successfully"
"updated-successfully": "Group {{name}} has been updated!",
"deleted-successfully": "Group {{name}} deleted successfully"
}
},
"kratos": {
Expand Down Expand Up @@ -3065,7 +3065,7 @@
"cancel": {
"title": "Discard Virtual Contributor",
"description": "Are you sure you want to stop creating your Virtual Contributor? Your work will not be saved. A space/subspace might already be created for you. Please, reload the page if you confirm the cancellation.",
"deleted": "Virtual Contributor deleted successfuly!"
"deleted": "Virtual Contributor deleted successfully!"
},
"addContent": {
"title": "Add knowledge",
Expand Down
4 changes: 2 additions & 2 deletions src/core/i18n/es/translation.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2675,8 +2675,8 @@
},
"operations": {
"user-group": {
"updated-successfuly": "El grupo {{name}} ha sido actualizado",
"deleted-successfuly": "El grupo {{name}} ha sido eliminado"
"updated-successfully": "El grupo {{name}} ha sido actualizado",
"deleted-successfully": "El grupo {{name}} ha sido eliminado"
}
},
"kratos": {
Expand Down
4 changes: 2 additions & 2 deletions src/core/i18n/fr/translation.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2675,8 +2675,8 @@
},
"operations": {
"user-group": {
"updated-successfuly": "Le groupe {{name}} a été mis à jour !",
"deleted-successfuly": "Groupe {{name}} supprimé avec succès"
"updated-successfully": "Le groupe {{name}} a été mis à jour !",
"deleted-successfully": "Groupe {{name}} supprimé avec succès"
}
},
"kratos": {
Expand Down
4 changes: 2 additions & 2 deletions src/core/i18n/nl/translation.nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -2675,8 +2675,8 @@
},
"operations": {
"user-group": {
"updated-successfuly": "Groep {{name}} is geupdate!",
"deleted-successfuly": "Groep {{name}} is succesvol verwijderd"
"updated-successfully": "Groep {{name}} is geupdate!",
"deleted-successfully": "Groep {{name}} is succesvol verwijderd"
}
},
"kratos": {
Expand Down
4 changes: 2 additions & 2 deletions src/core/i18n/pt/translation.pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -2675,8 +2675,8 @@
},
"operations": {
"user-group": {
"updated-successfuly": "O grupo {{name}} foi atualizado!",
"deleted-successfuly": "Grupo {{name}} excluído com sucesso"
"updated-successfully": "O grupo {{name}} foi atualizado!",
"deleted-successfully": "Grupo {{name}} excluído com sucesso"
}
},
"kratos": {
Expand Down
4 changes: 2 additions & 2 deletions src/core/i18n/ua/translation.ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -2675,8 +2675,8 @@
},
"operations": {
"user-group": {
"updated-successfuly": "Група {{name}} успішно оновлена!",
"deleted-successfuly": "Група {{name}} успішно видалена"
"updated-successfully": "Група {{name}} успішно оновлена!",
"deleted-successfully": "Група {{name}} успішно видалена"
}
},
"kratos": {
Expand Down
44 changes: 41 additions & 3 deletions src/domain/journey/common/JourneyCard/JourneyCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ComponentType, PropsWithChildren, ReactNode, useState } from 'react';
import { Box, SvgIconProps } from '@mui/material';
import { memo, ComponentType, PropsWithChildren, ReactNode, useState } from 'react';
import { Box, Paper, SvgIconProps } from '@mui/material';
import { LockOutlined } from '@mui/icons-material';
import ContributeCard, { ContributeCardProps } from '../../../../core/ui/card/ContributeCard';
import BadgeCardView from '../../../../core/ui/list/BadgeCardView';
Expand Down Expand Up @@ -64,7 +64,9 @@ const JourneyCard = ({
: {};

return (
<ContributeCard {...containerProps}>
<ContributeCard sx={{ position: 'relative' }} {...containerProps}>
{isPrivate && <PrivacyIcon />}
reactoholic marked this conversation as resolved.
Show resolved Hide resolved

<Box {...wrapperProps}>
<CardBanner
src={banner?.uri || defaultCardBanner}
Expand Down Expand Up @@ -98,3 +100,39 @@ const JourneyCard = ({
};

export default JourneyCard;

type PrivacyIconProps = {
size?: number;
top?: number;
right?: number;
ariaLabel?: string;
};
reactoholic marked this conversation as resolved.
Show resolved Hide resolved

export const PrivacyIcon = memo(
({ top = 10, size = 25, right = 10, ariaLabel = 'Private journey' }: PrivacyIconProps) => {
return (
<Paper
elevation={3}
sx={theme => ({
position: 'absolute',
zIndex: theme.zIndex.fab,
top: theme.spacing(top / 10),
right: theme.spacing(right / 10),

display: 'flex',
alignItems: 'center',
justifyContent: 'center',

width: size,
height: size,
borderRadius: '50%',
padding: theme.spacing(1.8),
backgroundColor: theme.palette.background.paper,
})}
aria-label={ariaLabel}
>
<LockOutlined fontSize="medium" color="primary" />
</Paper>
);
}
);
14 changes: 9 additions & 5 deletions src/domain/journey/common/JourneyTile/JourneyTile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { memo } from 'react';
import { memo } from 'react';
import { Visual } from '../../../common/visual/Visual';
import { Avatar, Box, Paper, Skeleton } from '@mui/material';
import RouterLink from '../../../../core/ui/link/RouterLink';
Expand All @@ -11,8 +11,9 @@ import webkitLineClamp from '../../../../core/ui/utils/webkitLineClamp';
import { BlockTitle } from '../../../../core/ui/typography';
import InsertPhotoOutlinedIcon from '@mui/icons-material/InsertPhotoOutlined';
import defaultJourneyCardBanner from '../../../../domain/journey/defaultVisuals/Card.jpg';
import { PrivacyIcon } from '../JourneyCard/JourneyCard';

interface JourneyTileProps {
type JourneyTileProps = {
journey:
| {
profile: {
Expand All @@ -23,16 +24,17 @@ interface JourneyTileProps {
}
| undefined;
journeyTypeName: JourneyTypeName;

columns?: number;
}
isPrivate?: boolean;
};

export const RECENT_JOURNEY_CARD_ASPECT_RATIO = '175/100';

const JOURNEY_TITLE_CLASS_NAME = 'JourneyTitle';

const ElevatedPaper = withElevationOnHover(Paper) as typeof Paper;

const JourneyTile = ({ journey, columns = 3 }: JourneyTileProps) => {
const JourneyTile = ({ journey, isPrivate, columns = 3 }: JourneyTileProps) => {
return (
<GridItem columns={columns}>
<ElevatedPaper
Expand All @@ -49,6 +51,8 @@ const JourneyTile = ({ journey, columns = 3 }: JourneyTileProps) => {
/>
) : (
<>
{isPrivate && <PrivacyIcon />}

<Avatar
src={journey.profile.cardBanner?.uri || defaultJourneyCardBanner}
sx={{ width: '100%', height: 'auto', aspectRatio: RECENT_JOURNEY_CARD_ASPECT_RATIO }}
Expand Down
2 changes: 1 addition & 1 deletion src/domain/platform/admin/components/Group/GroupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const GroupPage: FC<GroupPageProps> = ({ group }) => {

const [updateGroup] = useUpdateGroupMutation({
onCompleted: data =>
success(t('operations.user-group.updated-successfuly', { name: data.updateUserGroup.profile?.displayName })),
success(t('operations.user-group.updated-successfully', { name: data.updateUserGroup.profile?.displayName })),
});

const [createTagset] = useCreateTagsetOnProfileMutation({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useDeleteUserGroup = (options?: Options) => {

const [deleteGroup, { loading, error }] = useDeleteGroupMutation({
onCompleted: data => {
success(t('operations.user-group.deleted-successfuly', { name: data.deleteUserGroup.profile?.displayName }));
success(t('operations.user-group.deleted-successfully', { name: data.deleteUserGroup.profile?.displayName }));
options && options.onComplete && options.onComplete(data);
},
onError: options && options.onError && options.onError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ const DashboardSpaces = () => {

const { id, profile } = space;
const { tagline } = profile;

const hasChildMemberships = childMemberships?.length > 0;

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Caption, CaptionSmall } from '../../../../core/ui/typography';
import { Box, Button, Theme, useMediaQuery } from '@mui/material';
Expand Down