diff --git a/.github/workflows/ui-tests.yaml b/.github/workflows/ui-tests.yaml index 4a5817b6..464481f8 100644 --- a/.github/workflows/ui-tests.yaml +++ b/.github/workflows/ui-tests.yaml @@ -37,7 +37,7 @@ jobs: - uses: actions/checkout@v2 - name: Get PR number id: pull_request - run: echo "::set-output name=number::$(gh pr view --json number -q .number || echo "")" + run: echo "::set-output name=number::$(gh pr view --json number -q .number || echo "null")" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: actions/setup-node@v2 @@ -66,6 +66,10 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | + const pullRequestNumber = ${{ steps.pull_request.outputs.number }}; + if (pullRequestNumber === null) { + return; + } const fs = require('fs'); const deploymentUrl = fs.readFileSync('_vercel-deployment-url', 'utf8'); await github.rest.issues.createComment({ diff --git a/src/components/General/ColorPicker.tsx b/src/components/General/ColorPicker.tsx deleted file mode 100644 index 80d5afed..00000000 --- a/src/components/General/ColorPicker.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { useState } from 'react' -import { CirclePicker } from 'react-color' -import { XStack } from 'tamagui' - -const ColorPicker = () => { - const [chosenColor, setChosenColor] = useState('#FFFFFF') - return ( - - setChosenColor(color.hex)} - /> - - ) -} - -export default ColorPicker diff --git a/src/components/General/ColorPicker/ColorPicker.css b/src/components/General/ColorPicker/ColorPicker.css new file mode 100644 index 00000000..95d023e2 --- /dev/null +++ b/src/components/General/ColorPicker/ColorPicker.css @@ -0,0 +1,40 @@ +.color-picker-button { + width: 40px; + height: 40px; + border-radius: 50%; + margin-bottom: 10px; + margin-right: 10px; + position: relative; + outline: none; + border: none; +} + +.color-picker-button::before , +.color-picker-button::after { + display: block; + content: ""; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + transform-origin: center; + opacity: 0; + transition: 120ms opacity ease-in-out; +} +.color-picker-button::before { + content: "\2713"; + font-size: 25px; + color: white; +} +.color-picker-button::after { + width: 40px; + height: 40px; + border-radius: 50%; + border: 3px solid currentColor; +} + +.color-picker-button:focus::before, +.color-picker-button:focus::after, +.color-picker-button:hover::after { + opacity: 1; +} diff --git a/src/components/General/ColorPicker.stories.tsx b/src/components/General/ColorPicker/ColorPicker.stories.tsx similarity index 100% rename from src/components/General/ColorPicker.stories.tsx rename to src/components/General/ColorPicker/ColorPicker.stories.tsx diff --git a/src/components/General/ColorPicker/ColorPicker.tsx b/src/components/General/ColorPicker/ColorPicker.tsx new file mode 100644 index 00000000..a17a8465 --- /dev/null +++ b/src/components/General/ColorPicker/ColorPicker.tsx @@ -0,0 +1,41 @@ +import { XStack } from 'tamagui' +import { CustomPicker } from 'react-color' +import './ColorPicker.css' + +type ColorPickerProps = { + setChosenColor: (a: string) => void +} + +const ColorPicker = ({ setChosenColor }: ColorPickerProps) => { + const colors = [ + '#2A4AF5', + '#F6B03C', + '#7140FD', + '#2A799B', + '#EC266C', + '#1992D7', + '#FF7D46', + '#216266', + '#F66F8F', + '#C78F67', + '#CB6256', + ] + + return ( + <> + + {colors.map((color, i) => ( + + ))} + + + ) +} + +export default CustomPicker(ColorPicker) diff --git a/src/components/General/CreateAvatar/CreateAvatar.css b/src/components/General/CreateAvatar/CreateAvatar.css new file mode 100644 index 00000000..765ed56f --- /dev/null +++ b/src/components/General/CreateAvatar/CreateAvatar.css @@ -0,0 +1,10 @@ +.device-avatar { + width: 80px; + height: 80px; + border-radius: 50%; + flex-grow: 1; + display: flex; + align-items: center; + justify-content: center; + margin-right: -30px; +} \ No newline at end of file diff --git a/src/components/General/CreateAvatar/CreateAvatar.tsx b/src/components/General/CreateAvatar/CreateAvatar.tsx new file mode 100644 index 00000000..29adff6e --- /dev/null +++ b/src/components/General/CreateAvatar/CreateAvatar.tsx @@ -0,0 +1,52 @@ +import { useState } from 'react' +import { XStack, YStack } from 'tamagui' +import { Avatar, Text } from '@status-im/components' +import { ReactionIcon } from '@status-im/icons' +import './CreateAvatar.css' +import LabelInputField from '../LabelInputField' +import ColorPicker from '../ColorPicker/ColorPicker' +import EmojiPickerDialog from '../EmojiPickerDialog' + +const CreateAvatar = () => { + const [chosenColor, setChosenColor] = useState('#2A4AF5') + const [isEmojiDialogOpen, setIsEmojiDialogOpen] = useState(false) + return ( + + + + + + + + Device Avatar + + +
+ +
+ setIsEmojiDialogOpen(prev => !prev)} + style={{ cursor: 'pointer' }} + /> + } + /> + {isEmojiDialogOpen && } +
+
+ + + Highlight Color + + + +
+
+ ) +} + +export default CreateAvatar diff --git a/src/pages/CreateLocalNodePage/CreateLocalNodePage.tsx b/src/pages/CreateLocalNodePage/CreateLocalNodePage.tsx index 74322ad7..0204222e 100644 --- a/src/pages/CreateLocalNodePage/CreateLocalNodePage.tsx +++ b/src/pages/CreateLocalNodePage/CreateLocalNodePage.tsx @@ -1,17 +1,14 @@ import { useState } from 'react' -import { Button as StatusButton, Text, Avatar, Checkbox } from '@status-im/components' -import { NodeIcon, ReactionIcon } from '@status-im/icons' +import { Button as StatusButton, Text, Checkbox } from '@status-im/components' +import { NodeIcon } from '@status-im/icons' import { Label, Separator, XStack, YStack } from 'tamagui' import PageWrapperShadow from '../../components/PageWrappers/PageWrapperShadow' import Header from '../../components/General/Header' import Titles from '../../components/General/Titles' -import LabelInputField from '../../components/General/LabelInputField' -import ColorPicker from '../../components/General/ColorPicker' -import EmojiPickerDialog from '../../components/General/EmojiPickerDialog' +import CreateAvatar from '../../components/General/CreateAvatar/CreateAvatar' const CreateLocalNodePage = () => { const [autoConnectChecked, setAutoConnectChecked] = useState(false) - const [isEmojiDialogOpen, setIsEmojiDialogOpen] = useState(false) return ( @@ -22,39 +19,9 @@ const CreateLocalNodePage = () => { title="Create Local Node" subtitle="Configure your device to start Staking on Nimbus" /> - - - - - - - - Device Avatar - - - - setIsEmojiDialogOpen(prev => !prev)} - style={{ cursor: 'pointer' }} - /> - } - /> - {isEmojiDialogOpen && } - - - - - Highlight Color - - - - - + + + Settings diff --git a/src/pages/PairDevice/CreateAvatar.tsx b/src/pages/PairDevice/CreateAvatar.tsx deleted file mode 100644 index d23c9127..00000000 --- a/src/pages/PairDevice/CreateAvatar.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { XStack, YStack } from 'tamagui' -import LabelInputField from '../../components/General/LabelInputField' -import { Avatar, Text } from '@status-im/components' -import ColorPicker from '../../components/General/ColorPicker' -import { ReactionIcon } from '@status-im/icons' - -const CreateAvatar = () => { - return ( - - - - - - - - Device Avatar - - - - - - - - - Highlight Color - - - - - - ) -} - -export default CreateAvatar diff --git a/src/pages/PairDevice/PairDevice.tsx b/src/pages/PairDevice/PairDevice.tsx index a77a8ffb..d7915b0f 100644 --- a/src/pages/PairDevice/PairDevice.tsx +++ b/src/pages/PairDevice/PairDevice.tsx @@ -6,7 +6,7 @@ import PageWrapperShadow from '../../components/PageWrappers/PageWrapperShadow' import SyncStatus from './SyncStatus' import Titles from '../../components/General/Titles' import PairedSuccessfully from './PairedSuccessfully' -import CreateAvatar from './CreateAvatar' +import CreateAvatar from '../../components/General/CreateAvatar/CreateAvatar' import GenerateId from './GenerateId' import { NodeIcon } from '@status-im/icons' import Header from '../../components/General/Header'