Разработано несколько компонентов веб-интерфейса
Этот коммит содержится в:
родитель
1e22d40d19
Коммит
0c4bf26478
@ -12,7 +12,7 @@ const bottomBar = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const floatingActionButton = (
|
const floatingActionButton = (
|
||||||
<md-fab id="create-poll-button" label="Создать опрос">
|
<md-fab label="Создать опрос">
|
||||||
<md-icon slot="icon">add</md-icon>
|
<md-icon slot="icon">add</md-icon>
|
||||||
</md-fab>
|
</md-fab>
|
||||||
)
|
)
|
||||||
|
12
frontend/src/components/Card.css
Обычный файл
12
frontend/src/components/Card.css
Обычный файл
@ -0,0 +1,12 @@
|
|||||||
|
.card {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
background-color: var(--md-sys-color-surface-container);
|
||||||
|
border-radius: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card > * {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
11
frontend/src/components/Card.js
Обычный файл
11
frontend/src/components/Card.js
Обычный файл
@ -0,0 +1,11 @@
|
|||||||
|
import './Card.css'
|
||||||
|
|
||||||
|
export default function Card({
|
||||||
|
children,
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<div className="card">
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
@ -23,14 +23,16 @@
|
|||||||
scale: 0;
|
scale: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.full-screen-dialog > .content {
|
.full-screen-dialog > .scaffold > .content {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.full-screen-dialog > .content > * {
|
.full-screen-dialog > .scaffold > .content > * {
|
||||||
padding: 1rem;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
@ -1,22 +1,31 @@
|
|||||||
import '@material/web/iconbutton/icon-button.js'
|
import '@material/web/fab/fab'
|
||||||
import '@material/web/icon/icon.js'
|
import '@material/web/icon/icon'
|
||||||
import '@material/web/button/filled-button'
|
|
||||||
|
|
||||||
|
import Scaffold from './Scaffold'
|
||||||
import TopAppBar from './TopAppBar'
|
import TopAppBar from './TopAppBar'
|
||||||
|
|
||||||
import './FullScreenDialog.css'
|
import './FullScreenDialog.css'
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
const floatingActionButton = (
|
||||||
|
<md-fab>
|
||||||
|
<md-icon slot="icon">add</md-icon>
|
||||||
|
</md-fab>
|
||||||
|
)
|
||||||
|
|
||||||
export default function ({
|
export default function ({
|
||||||
setEditPoll,
|
setEditPoll,
|
||||||
classList,
|
classList,
|
||||||
children,
|
children,
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className={`full-screen-dialog ${classList}`}>
|
<div className={`full-screen-dialog ${classList}`}>
|
||||||
<TopAppBar onDismissRequest={() => setEditPoll(false)} />
|
<Scaffold
|
||||||
<div className="content">
|
topBar={
|
||||||
{children}
|
<TopAppBar onDismissRequest={() => setEditPoll(false)}/>
|
||||||
</div>
|
}
|
||||||
|
floatingActionButton={floatingActionButton}
|
||||||
|
content={children} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
nav {
|
nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
padding-bottom: .5rem;
|
||||||
background-color: var(--md-sys-color-surface-container-high);
|
background-color: var(--md-sys-color-surface-container-high);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
label,
|
||||||
|
.messages-title,
|
||||||
|
.title {
|
||||||
|
color: var(--md-sys-color-on-surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.messages-title {
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title:not(:first-child) {
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poll-options {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poll-options > .poll-option {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poll-options > .poll-option > .option-text {
|
||||||
|
flex-grow: 1;
|
||||||
|
flex-shrink: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poll-options > .poll-option > .option-action {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 1rem;
|
||||||
|
}
|
@ -1,14 +1,15 @@
|
|||||||
import React, {useEffect, useState} from "react"
|
import React, {useEffect, useState} from 'react'
|
||||||
import '@material/web/textfield/outlined-text-field'
|
import '@material/web/textfield/outlined-text-field'
|
||||||
import '@material/web/fab/fab'
|
import '@material/web/fab/fab'
|
||||||
import '@material/web/icon/icon'
|
import '@material/web/icon/icon'
|
||||||
import '@material/web/select/outlined-select'
|
import '@material/web/select/outlined-select'
|
||||||
import '@material/web/select/select-option'
|
import '@material/web/select/select-option'
|
||||||
import '@material/web/list/list'
|
import '@material/web/iconbutton/filled-icon-button'
|
||||||
import '@material/web/list/list-item'
|
import '@material/web/checkbox/checkbox'
|
||||||
|
|
||||||
import FullScreenDialog from "../components/FullScreenDialog"
|
import PollListItem from '../components/PollListItem'
|
||||||
import PollListItem from "../components/PollListItem"
|
import FullScreenDialog from '../components/FullScreenDialog'
|
||||||
|
import Card from '../components/Card'
|
||||||
|
|
||||||
import './PollsScreen.css'
|
import './PollsScreen.css'
|
||||||
|
|
||||||
@ -102,33 +103,87 @@ export default function PollsScreen() {
|
|||||||
</md-outlined-select>
|
</md-outlined-select>
|
||||||
|
|
||||||
<section id="poll-messages">
|
<section id="poll-messages">
|
||||||
<div className="md-typescale-title-medium">Сообщения</div>
|
|
||||||
<md-list>
|
<div className="messages-title md-typescale-title-medium">Сообщения</div>
|
||||||
<md-list-item>
|
|
||||||
Fruits
|
<Card>
|
||||||
</md-list-item>
|
|
||||||
<md-divider></md-divider>
|
<div className="title md-typescale-title-small">Сообщение 1</div>
|
||||||
<md-list-item>
|
|
||||||
Apple
|
<md-outlined-select label="Тип" value="poll" required="required">
|
||||||
</md-list-item>
|
|
||||||
<md-list-item>
|
<md-icon slot="leading-icon">attach_file</md-icon>
|
||||||
Banana
|
|
||||||
</md-list-item>
|
<md-select-option value="text">
|
||||||
<md-list-item>
|
<div slot="headline">Текст</div>
|
||||||
<div slot="headline">Cucumber</div>
|
</md-select-option>
|
||||||
<div slot="supporting-text">Cucumbers are long green fruits that are just as long as this
|
|
||||||
multi-line description
|
<md-select-option value="poll">
|
||||||
|
<div slot="headline">Опрос</div>
|
||||||
|
</md-select-option>
|
||||||
|
|
||||||
|
<md-select-option value="image">
|
||||||
|
<div slot="headline">Изображение</div>
|
||||||
|
</md-select-option>
|
||||||
|
|
||||||
|
<md-select-option value="video">
|
||||||
|
<div slot="headline">Видео</div>
|
||||||
|
</md-select-option>
|
||||||
|
|
||||||
|
<md-select-option value="audio">
|
||||||
|
<div slot="headline">Аудио</div>
|
||||||
|
</md-select-option>
|
||||||
|
|
||||||
|
<md-select-option value="file">
|
||||||
|
<div slot="headline">Файл</div>
|
||||||
|
</md-select-option>
|
||||||
|
|
||||||
|
</md-outlined-select>
|
||||||
|
|
||||||
|
<md-outlined-text-field
|
||||||
|
label="Вопрос"
|
||||||
|
value=""
|
||||||
|
required="required">
|
||||||
|
<md-icon slot="leading-icon">contact_support</md-icon>
|
||||||
|
</md-outlined-text-field>
|
||||||
|
|
||||||
|
<div className="title md-typescale-title-small">Варианты ответа</div>
|
||||||
|
|
||||||
|
<div className="poll-options">
|
||||||
|
|
||||||
|
<div className="poll-option">
|
||||||
|
<md-outlined-text-field
|
||||||
|
class="option-text"
|
||||||
|
label="Добавить ответ"
|
||||||
|
value=""
|
||||||
|
required="required" />
|
||||||
|
<md-filled-icon-button class="option-action">
|
||||||
|
<md-icon>arrow_forward</md-icon>
|
||||||
|
</md-filled-icon-button>
|
||||||
</div>
|
</div>
|
||||||
</md-list-item>
|
|
||||||
<md-list-item
|
|
||||||
type="link"
|
</div>
|
||||||
href="https://google.com/search?q=buy+kiwis&tbm=shop"
|
|
||||||
target="_blank">
|
<div className="title md-typescale-title-small">Настройки</div>
|
||||||
<div slot="headline">Shop for Kiwis</div>
|
|
||||||
<div slot="supporting-text">This will link you out in a new tab</div>
|
<label className="md-typescale-body-large">
|
||||||
<md-icon slot="end">open_in_new</md-icon>
|
<md-checkbox touch-target="wrapper"></md-checkbox>
|
||||||
</md-list-item>
|
Анонимное голосование
|
||||||
</md-list>
|
</label>
|
||||||
|
|
||||||
|
<label className="md-typescale-body-large">
|
||||||
|
<md-checkbox touch-target="wrapper"></md-checkbox>
|
||||||
|
Выбор нескольких ответов
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label className="md-typescale-body-large">
|
||||||
|
<md-checkbox touch-target="wrapper"></md-checkbox>
|
||||||
|
Не уведомлять получателей
|
||||||
|
</label>
|
||||||
|
|
||||||
|
</Card>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</FullScreenDialog>
|
</FullScreenDialog>
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user