This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9501 from matrix-org/psg-863/dm-learn-more-rename
Device manager - add extra details to device security and renaming (PSG-863)
- Loading branch information
Showing
12 changed files
with
248 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
81 changes: 81 additions & 0 deletions
81
src/components/views/settings/devices/DeviceSecurityLearnMore.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
Copyright 2022 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { _t } from "../../../../languageHandler"; | ||
import LearnMore, { LearnMoreProps } from "../../elements/LearnMore"; | ||
import { DeviceSecurityVariation } from "./types"; | ||
|
||
interface Props extends Omit<LearnMoreProps, 'title' | 'description'> { | ||
variation: DeviceSecurityVariation; | ||
} | ||
|
||
const securityCardContent: Record<DeviceSecurityVariation, { | ||
title: string; | ||
description: React.ReactNode | string; | ||
}> = { | ||
[DeviceSecurityVariation.Verified]: { | ||
title: _t('Verified sessions'), | ||
description: <> | ||
<p>{ _t('Verified sessions have logged in with your credentials and then been verified, either using your secure passphrase or by cross-verifying.') } | ||
</p> | ||
<p> | ||
{ _t( | ||
`This means they hold encryption keys for your previous messages, ` + | ||
`and confirm to other users you are communicating with that these sessions are really you.`, | ||
) | ||
} | ||
</p> | ||
</>, | ||
}, | ||
[DeviceSecurityVariation.Unverified]: { | ||
title: _t('Unverified sessions'), | ||
description: <> | ||
<p>{ _t('Unverified sessions are sessions that have logged in with your credentials but have not been cross-verified.') } | ||
</p> | ||
<p> | ||
{ _t( | ||
`You should make especially certain that you recognise these sessions ` + | ||
`as they could represent an unauthorised use of your account.`, | ||
) | ||
} | ||
</p> | ||
</>, | ||
}, | ||
[DeviceSecurityVariation.Inactive]: { | ||
title: _t('Inactive sessions'), | ||
description: <> | ||
<p>{ _t('Inactive sessions are sessions you have not used in some time, but they continue to receive encryption keys.') } | ||
</p> | ||
<p> | ||
{ _t( | ||
`Removing inactive sessions improves security and performance, ` + | ||
`and makes it easier for you to identify if a new session is suspicious.`, | ||
) | ||
} | ||
</p> | ||
</>, | ||
}, | ||
}; | ||
|
||
/** | ||
* LearnMore with content for device security warnings | ||
*/ | ||
export const DeviceSecurityLearnMore: React.FC<Props> = ({ variation }) => { | ||
const { title, description } = securityCardContent[variation]; | ||
return <LearnMore title={title} description={description} />; | ||
}; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.