Skip to content

Commit

Permalink
delete tooltips, add width tooltips, fix margin btn, add cursor point…
Browse files Browse the repository at this point in the history
…er in row table
  • Loading branch information
nenichv committed Jul 1, 2024
1 parent 5f99fef commit 0e30f86
Show file tree
Hide file tree
Showing 10 changed files with 147 additions and 209 deletions.
28 changes: 12 additions & 16 deletions apps/schools/domains/circle/components/changeCircleForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { Button } from '@domains/common/components/button'
import { useChangeCircleFormValidators } from './hooks'
import { useGetAllCirclesQuery } from '@domains/organization/redux/organizationApi'
import { useOrganization } from '@domains/organization/providers/organizationProvider'
import { WithTooltip } from '@domains/common/components/tooltip/withTooltip'
import { TOOLTIP_MARGIN } from './styles/styles'
import { isValidFormCheck } from '@domains/common/utils/form'
import { CIRCLE_NAME, CIRCLE_ADDRESS, ADDRESS_ROOM } from './constants'
import classnames from 'classnames'
Expand Down Expand Up @@ -80,22 +78,20 @@ export const ChangeCircleForm = () => {
layout='vertical'
>
<Typography.Title level={1}>Редактирование кружка</Typography.Title>
<WithTooltip tooltipText={'Здесь будет текст тултипа'} margin={TOOLTIP_MARGIN}>
<Form.Item
required={true}
label={
<span>
<Form.Item
required={true}
label={
<span>
<span className={styles.requiredMark}>*</span> Название
</span>
}
name={CIRCLE_NAME}
className={styles.label}
rules={validators.name}
initialValue={initialValues[CIRCLE_NAME]}
>
<Input required={true} placeholder='Введите название кружка' />
</Form.Item>
</WithTooltip>
}
name={CIRCLE_NAME}
className={styles.label}
rules={validators.name}
initialValue={initialValues[CIRCLE_NAME]}
>
<Input required={true} placeholder='Введите название кружка' />
</Form.Item>

<Row className={styles.complexInputContainer}>
{!circlesData.isLoading ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
font-style: normal;
font-weight: 400;
line-height: 22px;
width: 95%;

:global {
.ant-select-selector {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { RowType, TableType } from './interfaces'
import { searchStudentsColumns } from './constants'
import { useGetAllCirclesQuery } from '@domains/organization/redux/organizationApi'
import EmptyWrapper from '@domains/common/components/containers/EmptyWrapper'
import { mapReturnedData } from '@domains/common/redux/utils'
import { HighlightText } from '@domains/common/components/table/forming'
import { getVarsForAddressColumn } from '@domains/common/utils/geo'
import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
Expand Down Expand Up @@ -97,6 +96,7 @@ export function CircleList() {
customWidths={[60, 25, 15]}
searchRequestText={searchRequestText}
setSearchRequestText={setSearchRequestText}
rowClassName={styles.tableRowPointer}
/>
</EmptyWrapper>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@
font-style: normal;
font-weight: 400;
line-height: 22px;
}
}

.tableRowPointer:hover {
cursor: pointer;
}
38 changes: 5 additions & 33 deletions apps/schools/domains/circle/components/createCircleForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { Form, Typography, Input as AntdInput, Row, Spin, Tooltip } from 'antd'
import { Form, Typography, Input as AntdInput, Row, Spin } from 'antd'
import React, { useEffect, useState } from 'react'
import { Input } from '@domains/common/components/input'
import styles from './styles/styles.module.scss'
import { Button } from '@domains/common/components/button'
import { useCreateCircleFormValidators } from './hooks'
import { useGetAllCirclesQuery } from '@domains/organization/redux/organizationApi'
import { useOrganization } from '@domains/organization/providers/organizationProvider'
import { WithTooltip } from '@domains/common/components/tooltip/withTooltip'
import { TOOLTIP_MARGIN } from './styles/styles'
import { isValidFormCheck } from '@domains/common/utils/form'
import { CIRCLE_NAME, CIRCLE_ADDRESS, ADDRESS_ROOM } from './constants'
import classnames from 'classnames'
import { AimOutlined, QuestionCircleFilled } from '@ant-design/icons'
import { AimOutlined } from '@ant-design/icons'
import { Select } from '@domains/common/components/select'
import { useCreateCircleMutation } from '../../redux/circleApi'
import { getVarsForAddressColumn } from '@domains/common/utils/geo'
Expand All @@ -21,14 +19,6 @@ import { mapSteps } from '@domains/circle/interfaces/mapStepsType'
import { FormMapSteps } from '@domains/circle/constants/Enums'
import Image from 'next/image'
import android from '@public/image/Android 11.png'
import {
DEFAULT_ICON_SIZE,
DEFAULT_MARGIN,
DEFAULT_OVERLAY_INNER_COLOR,
DEFAULT_OVERLAY_INNER_STYLE,
ICON_SIZES,
} from '@domains/common/components/tooltip/styles/styles'
import { BackPage } from '@domains/common/components/backPage'

export const CreateCircleForm = () => {
const validators = useCreateCircleFormValidators()
Expand Down Expand Up @@ -93,28 +83,10 @@ export const CreateCircleForm = () => {
>
<Input
required={true}
inputContainerClass={styles.inputWithTooltipContainer}
className={styles.inputWithTooltip}
inputContainerClass={styles.inputContainer}
className={styles.input}
placeholder='Введите название кружка'
>
<div className={styles.tooltipContainer}>
<Tooltip
placement='right'
title={'Здесь будет текст тултипа'}
color={DEFAULT_OVERLAY_INNER_COLOR}
style={{ height: 'auto' }}
overlayInnerStyle={DEFAULT_OVERLAY_INNER_STYLE}
>
<QuestionCircleFilled
style={{
top: `${TOOLTIP_MARGIN}`,
marginBottom: '10px',
fontSize: ICON_SIZES[DEFAULT_ICON_SIZE],
}}
/>
</Tooltip>
</div>
</Input>
/>
</Form.Item>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
width: 3%;
}

.inputWithTooltipContainer {
.inputContainer {
display: flex;
flex-direction: row;
justify-content: unset;
}

.inputWithTooltip {
.input {
width: 70%;
margin-right: 5px;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import { useCreateEmployeeFormValidators } from './hooks'
import { useInviteEmployeeMutation } from '@domains/organization/redux/organizationApi'
import { useOrganization } from '@domains/organization/providers/organizationProvider'
import { handleSubmitForm } from '@domains/employee/handlers/employeeCreate'
import router, { useRouter } from 'next/router'
import { WithTooltip } from '@domains/common/components/tooltip/withTooltip'
import { TOOLTIP_MARGIN } from '@domains/employee/components/createEmployeeForm/styles/styles'
import { useRouter } from 'next/router'
import { isValidFormCheck } from '@domains/common/utils/form'
import {
EMPLOYEE_EMAIL,
Expand Down Expand Up @@ -45,55 +43,47 @@ export const CreateEmployeeForm = () => {
}}
layout='vertical'
>
<Typography.Title level={1}>Добавление Сотрудника</Typography.Title>
<WithTooltip tooltipText={'Здесь будет текст тултипа'} margin={TOOLTIP_MARGIN}>
<Form.Item
required={true}
label={
<span>
<Typography.Title level={1}>Добавление сотрудника</Typography.Title>
<Form.Item
required={true}
label={
<span>
<span className={styles.requiredMark}>*</span> Телефон сотрудника
</span>
}
name={EMPLOYEE_PHONE}
className={styles.label}
rules={validators.phone}
>
<Input required={true} customType='inputPhone' placeholder='Введите телефон сотрудника' />
</Form.Item>
</WithTooltip>
}
name={EMPLOYEE_PHONE}
className={styles.label}
rules={validators.phone}
>
<Input required={true} customType='inputPhone' placeholder='Введите телефон сотрудника' />
</Form.Item>

<WithTooltip tooltipText={'Здесь будет текст тултипа'} margin={TOOLTIP_MARGIN}>
<Form.Item
required
label={
<span>
<Form.Item
required
label={
<span>
<span className={styles.requiredMark}>*</span> Ф. И. О. сотрудника
</span>
}
name={EMPLOYEE_NAME}
className={styles.label}
rules={validators.name}
>
<Input placeholder='Введите Ф. И. О. сотрудника' />
</Form.Item>
</WithTooltip>
}
name={EMPLOYEE_NAME}
className={styles.label}
rules={validators.name}
>
<Input placeholder='Введите Ф. И. О. сотрудника' />
</Form.Item>

<WithTooltip tooltipText={'Здесь будет текст тултипа'} margin={TOOLTIP_MARGIN}>
<Form.Item
label='Email сотрудника'
name={EMPLOYEE_EMAIL}
className={styles.label}
rules={validators.email}
>
<Input type='email' placeholder='Введите email сотрудника' />
</Form.Item>
</WithTooltip>
<Form.Item
label='Email сотрудника'
name={EMPLOYEE_EMAIL}
className={styles.label}
rules={validators.email}
>
<Input type='email' placeholder='Введите email сотрудника' />
</Form.Item>

<WithTooltip tooltipText={'Здесь будет текст тултипа'} margin={TOOLTIP_MARGIN}>
<Form.Item label='Должность сотрудника' name={EMPLOYEE_POSITION} className={styles.label}>
<Input placeholder='Введите должность сотрудника' />
</Form.Item>
</WithTooltip>
<Form.Item label='Должность сотрудника' name={EMPLOYEE_POSITION} className={styles.label}>
<Input placeholder='Введите должность сотрудника' />
</Form.Item>

<Form.Item name='button'>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
font-style: normal;
font-weight: 400;
line-height: 22px;
width: 90%;
}

.button {
Expand Down
Loading

0 comments on commit 0e30f86

Please sign in to comment.