Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2eedcc8

Browse files
BrunoQuaresmakylecarbs
authored andcommitted
feat: Add copy button to the SSH Page (#1962)
1 parented2207f commit2eedcc8

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

‎site/src/components/CodeExample/CodeExample.stories.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ export const Example = Template.bind({})
1717
Example.args={
1818
code:sampleCode,
1919
}
20+
21+
exportconstLongCode=Template.bind({})
22+
LongCode.args={
23+
code:"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICnKzATuWwmmt5+CKTPuRGN0R1PBemA+6/SStpLiyX+L",
24+
}

‎site/src/components/CodeExample/CodeExample.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const useStyles = makeStyles((theme) => ({
2828
root:{
2929
display:"flex",
3030
flexDirection:"row",
31-
justifyContent:"space-between",
3231
alignItems:"center",
3332
background:theme.palette.background.default,
3433
color:theme.palette.primary.contrastText,
@@ -39,6 +38,13 @@ const useStyles = makeStyles((theme) => ({
3938
},
4039
code:{
4140
padding:`${theme.spacing(0.5)}px${theme.spacing(0.75)}px${theme.spacing(0.5)}px${theme.spacing(2)}px`,
41+
whiteSpace:"nowrap",
42+
width:"100%",
43+
overflowX:"auto",
44+
// Have a better area to display the scrollbar
45+
height:42,
46+
display:"flex",
47+
alignItems:"center",
4248
},
4349
button:{
4450
border:0,

‎site/src/pages/UserSettingsPage/SSHKeysPage/SSHKeysPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Button from "@material-ui/core/Button"
33
importCircularProgressfrom"@material-ui/core/CircularProgress"
44
import{useActor}from"@xstate/react"
55
importReact,{useContext,useEffect}from"react"
6-
import{CodeBlock}from"../../../components/CodeBlock/CodeBlock"
6+
import{CodeExample}from"../../../components/CodeExample/CodeExample"
77
import{ConfirmDialog}from"../../../components/ConfirmDialog/ConfirmDialog"
88
import{Section}from"../../../components/Section/Section"
99
import{Stack}from"../../../components/Stack/Stack"
@@ -41,10 +41,10 @@ export const SSHKeysPage: React.FC = () => {
4141

4242
{sshKey&&(
4343
<Stack>
44-
<CodeBlocklines={[sshKey.public_key.trim()]}/>
44+
<CodeExamplecode={sshKey.public_key.trim()}/>
4545
<div>
4646
<Button
47-
color="primary"
47+
variant="outlined"
4848
onClick={()=>{
4949
authSend({type:"REGENERATE_SSH_KEY"})
5050
}}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp