Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

amam/fix_endpoint page #1964

Merged
merged 1 commit into from
Aug 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions src/pages/endpoint/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react'
import styled from 'styled-components'
import { Formik, Form } from 'formik'
import device from 'themes/device'
import { WithIntl } from 'components/localization'
import Layout from 'components/layout/layout'
import { Container, SEO } from 'components/containers'
Expand All @@ -13,6 +14,17 @@ import { getAppId } from 'common/websocket/config'
import { DerivStore } from 'store'
import { useLocalStorageState } from 'components/hooks/use-localstorage-state'

const StyledInput = styled(Input)`
& ~ label {
transform: translate(-0.6rem, -2rem) scale(0.7);
color: var(--color-black-3);
background-color: var(--color-${(props) => props.background || 'grey-1'});
@media ${device.tabletL} {
top: 9px;
}
}
`

const StyledContainer = styled(Container)`
text-align: center;
height: 100vh;
Expand Down Expand Up @@ -73,9 +85,8 @@ const Endpoint = () => {
const [server_url, setServerUrl] = useLocalStorageState(default_server_url, 'config.server_url')
const [app_id, setAppId] = useLocalStorageState(getAppId(), 'config.app_id')
const [reset_loading, setResetLoading] = React.useState(false)
const { website_status, setWebsiteStatus, website_status_loading } = React.useContext(
DerivStore,
)
const { website_status, setWebsiteStatus, website_status_loading } =
React.useContext(DerivStore)
const STATUS_TIMEOUT_DELAY = 1500
const RESET_TIMEOUT_DELAY = 500

Expand Down Expand Up @@ -161,7 +172,7 @@ const Endpoint = () => {
}) => (
<Form noValidate>
<InputGroup>
<Input
<StyledInput
name="server_url"
error={errors.server_url}
value={values.server_url}
Expand All @@ -174,7 +185,7 @@ const Endpoint = () => {
background="white"
placeholder={'e.g. green.binaryws.com'}
/>
<Input
<StyledInput
name="app_id"
error={errors.app_id}
value={values.app_id}
Expand All @@ -187,7 +198,7 @@ const Endpoint = () => {
background="white"
placeholder={'e.g. 9999'}
/>
<Input
<StyledInput
name="clients_country"
error={errors.clients_country}
value={values.clients_country}
Expand Down