1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 14:15:06 +01:00
metamask-extension/ui/components/app/snaps/snap-version/snap-version.js
Frederik Bolding f829f0069d
[FLASK] Allow Snaps to use eth_accounts as a revokable permission (#19306)
* Add support for snap authorship component at the top of PermissionConnect

* Add PermissionCellOptions

* Add details popover

* Add action for revoking dynamic permissions

* Improve UI and revoke logic

* Better eth_accounts screen support

* Fix tests

* Fix lint

* More linting fixes

* Fix missing fence

* Add another fence

* Unnest permission page to fix weird CSS issues

* Hide footer on permissions connect when using a snap
2023-07-06 22:54:27 +02:00

71 lines
1.5 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import {
AlignItems,
BackgroundColor,
BorderRadius,
Color,
FLEX_DIRECTION,
TextVariant,
} from '../../../../helpers/constants/design-system';
import Box from '../../../ui/box';
import {
BUTTON_VARIANT,
Button,
Icon,
IconName,
IconSize,
Text,
} from '../../../component-library';
import Preloader from '../../../ui/icon/preloader/preloader-icon.component';
const SnapVersion = ({ version, url }) => {
return (
<Button
variant={BUTTON_VARIANT.LINK}
href={url}
target="_blank"
className="snap-version"
>
<Box
className="snap-version__wrapper"
flexDirection={FLEX_DIRECTION.ROW}
alignItems={AlignItems.center}
backgroundColor={BackgroundColor.backgroundAlternative}
borderRadius={BorderRadius.pill}
paddingTop={1}
paddingBottom={1}
paddingLeft={2}
paddingRight={2}
>
{version ? (
<Text color={Color.textAlternative} variant={TextVariant.bodyMd}>
{version}
</Text>
) : (
<Preloader size={18} />
)}
<Icon
name={IconName.Export}
color={Color.textAlternative}
size={IconSize.Sm}
marginLeft={1}
/>
</Box>
</Button>
);
};
SnapVersion.propTypes = {
/**
* The version of the snap
*/
version: PropTypes.string,
/**
* The url to the snap package
*/
url: PropTypes.string,
};
export default SnapVersion;