mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 04:16:00 +00:00
add connection modal
This commit is contained in:
35
web/src/utility/forms.js
Normal file
35
web/src/utility/forms.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { TextField } from './inputs';
|
||||
import { Field } from 'formik';
|
||||
|
||||
export const FormRow = styled.div`
|
||||
display: flex;
|
||||
margin: 10px;
|
||||
`;
|
||||
|
||||
export const FormLabel = styled.div`
|
||||
width: 10vw;
|
||||
font-weight: bold;
|
||||
`;
|
||||
|
||||
export const FormValue = styled.div``;
|
||||
|
||||
export function FormTextField({ label, ...other }) {
|
||||
return (
|
||||
<FormRow>
|
||||
<FormLabel>{label}</FormLabel>
|
||||
<FormValue>
|
||||
<Field {...other} as={TextField} />
|
||||
</FormValue>
|
||||
</FormRow>
|
||||
);
|
||||
}
|
||||
|
||||
export function FormSubmit({text}) {
|
||||
return (
|
||||
<FormRow>
|
||||
<input type="submit" value={text}/>
|
||||
</FormRow>
|
||||
);
|
||||
}
|
||||
5
web/src/utility/inputs.js
Normal file
5
web/src/utility/inputs.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import React from 'react';
|
||||
|
||||
export function TextField({ ...other }) {
|
||||
return <input type="text" {...other}></input>;
|
||||
}
|
||||
7
web/src/utility/layout.js
Normal file
7
web/src/utility/layout.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import styled from 'styled-components';
|
||||
|
||||
export const Grid = styled.div``;
|
||||
|
||||
export const Row = styled.div``;
|
||||
|
||||
export const Col = styled.div``;
|
||||
Reference in New Issue
Block a user