mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 17:41:33 +03:00
Merge pull request #3930 from tylershuster/copy-base-hash
launch: click to copy base hash
This commit is contained in:
commit
5399d76052
@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import Helmet from 'react-helmet';
|
||||
import styled from 'styled-components';
|
||||
|
||||
@ -10,6 +10,7 @@ import Tiles from './components/tiles';
|
||||
import Tile from './components/tiles/tile';
|
||||
import Welcome from './components/welcome';
|
||||
import Groups from './components/Groups';
|
||||
import { writeText } from '~/logic/lib/util';
|
||||
|
||||
const ScrollbarLessBox = styled(Box)`
|
||||
scrollbar-width: none !important;
|
||||
@ -19,9 +20,8 @@ const ScrollbarLessBox = styled(Box)`
|
||||
}
|
||||
`;
|
||||
|
||||
export default class LaunchApp extends React.Component {
|
||||
render() {
|
||||
const { props } = this;
|
||||
export default function LaunchApp(props) {
|
||||
const [hashText, setHashText] = useState(props.baseHash);
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -78,11 +78,17 @@ export default class LaunchApp extends React.Component {
|
||||
borderRadius={2}
|
||||
fontSize={0}
|
||||
p={2}
|
||||
cursor="pointer"
|
||||
onClick={() => {
|
||||
writeText(props.baseHash);
|
||||
setHashText('copied');
|
||||
setTimeout(() => {
|
||||
setHashText(props.baseHash);
|
||||
}, 2000);
|
||||
}}
|
||||
>
|
||||
{props.baseHash}
|
||||
{hashText || props.baseHash}
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user