Skip to content

Commit

Permalink
Мелкие фиксы
Browse files Browse the repository at this point in the history
  • Loading branch information
Холина Дарья Анатольевна committed Nov 12, 2024
1 parent 651376d commit c7a0e87
Show file tree
Hide file tree
Showing 14 changed files with 256 additions and 137 deletions.
42 changes: 22 additions & 20 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ body {

.ant-app {
height: 100%;
;

.ant-layout {
height: 100%;
font-size: 16px;

.ant-layout-content {
background: rgb(252, 252, 252);

.view {
padding: 1em;
height: 100%;
height: calc(100vh - 65px);
text-align: center;
overflow-y: auto;
//overflow-y: auto;

> h5, > h4 {
margin-top: 8px;
Expand All @@ -33,21 +35,21 @@ body {
}
}

.app {
//font-size: 16px;
//text-align: center;

> .ant-layout {
height: 100vh;

> .ant-layout-content {

.view {
height: 100%;
padding: 1em;
}
}
}


}
//.app {
// //font-size: 16px;
// //text-align: center;
//
// > .ant-layout {
// height: 100vh;
//
// > .ant-layout-content {
//
// .view {
// height: 100%;
// padding: 1em;
// }
// }
// }
//
//
//}
59 changes: 2 additions & 57 deletions src/icons/car.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,66 +3,11 @@ import React from 'react';
import Icon from '@ant-design/icons';
import { Property } from 'csstype';

const blackStroke = {
fill: 'none',
stroke: 'currentColor',
strokeWidth: 2,
strokeLinecap: 'round' as Property.StrokeLinecap,
strokeLinejoin: 'round' as Property.StrokeLinejoin,
strokeMiterlimit: 10
};

function CarSvg() {
return (
<svg
enableBackground="new 0 0 32 32"
viewBox="0 0 32 32"
width="1em"
height="1em"
>
<circle
style={blackStroke}
cx="7"
cy="23"
r="3"
/>
<circle
style={blackStroke}
cx="23"
cy="23"
r="3"
/>
<line
style={blackStroke}
x1="28"
x2="30"
y1="19"
y2="19"
/>
<line
style={blackStroke}
x1="4"
x2="24"
y1="16"
y2="16"
/>
<line
style={blackStroke}
x1="13"
x2="10"
y1="10"
y2="16"
/>
<svg viewBox="0 0 512 512" fill="currentColor">
<path
style={blackStroke}
d="M26,23h4c0.6,0,1-0.4,1-1v-2c0-2.2-1.8-4-4-4h-3l-3.8-4.6c-0.8-0.9-1.9-1.4-3.1-1.4H9.5c-1.5,0-2.9,0.9-3.6,2.2 L4,16H3c-1.1,0-2,0.9-2,2v4c0,0.6,0.4,1,1,1h2"
/>
<line
style={blackStroke}
x1="10"
x2="20"
y1="23"
y2="23"
d="M499.99 176h-59.87l-16.64-41.6C406.38 91.63 365.57 64 319.5 64h-127c-46.06 0-86.88 27.63-103.99 70.4L71.87 176H12.01C4.2 176-1.53 183.34.37 190.91l6 24C7.7 220.25 12.5 224 18.01 224h20.07C24.65 235.73 16 252.78 16 272v48c0 16.12 6.16 30.67 16 41.93V416c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32v-32h256v32c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32v-54.07c9.84-11.25 16-25.8 16-41.93v-48c0-19.22-8.65-36.27-22.07-48H494c5.51 0 10.31-3.75 11.64-9.09l6-24c1.89-7.57-3.84-14.91-11.65-14.91zm-352.06-17.83c7.29-18.22 24.94-30.17 44.57-30.17h127c19.63 0 37.28 11.95 44.57 30.17L384 208H128l19.93-49.83zM96 319.8c-19.2 0-32-12.76-32-31.9S76.8 256 96 256s48 28.71 48 47.85-28.8 15.95-48 15.95zm320 0c-19.2 0-48 3.19-48-15.95S396.8 256 416 256s32 12.76 32 31.9-12.8 31.9-32 31.9z"
/>
</svg>
);
Expand Down
43 changes: 43 additions & 0 deletions src/icons/gate.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* eslint-disable max-len,react/jsx-props-no-spreading, no-tabs */
import React from 'react';
import Icon from '@ant-design/icons';

function GateSvg() {
return (
<svg
viewBox="0 0 512.001 512.001"
// stroke="currentColor"
fill="currentColor"
width="1em"
height="1em"
// strokeLinecap="round"
// strokeLinejoin="round"
// strokeWidth="2"
>
<g transform="translate(0 -1)">
<g>
<g>
<polygon points="259.534,137.534 208.334,188.734 252.468,188.734 303.668,137.534 " />
<polygon points="327.8,137.534 276.6,188.734 320.735,188.734 371.935,137.534 " />
<path d="M144.845,137.534c-6.153-8.132-15.027-14.097-25.378-16.205v-10.317c0-13.611-11.068-24.678-24.678-24.678H41.745
c-13.611,0-24.678,11.068-24.678,24.678v265.566C7.569,377.175,0,385.018,0,394.66v14.814c0,10.027,8.158,18.193,18.193,18.193
H118.34c10.035,0,18.193-8.166,18.193-18.193V394.66c0-9.643-7.569-17.485-17.067-18.082V204.939
c10.351-2.108,19.226-8.073,25.378-16.205h39.356l51.2-51.2H144.845z M119.467,409.474c0,0.623-0.512,1.126-1.126,1.126H18.193
c-0.614,0-1.126-0.503-1.126-1.126V394.66c0-0.623,0.512-1.126,1.126-1.126H118.34c0.614,0,1.126,0.504,1.126,1.126V409.474z
M110.933,188.734c-14.114,0-25.6-11.486-25.6-25.6s11.486-25.6,25.6-25.6s25.6,11.486,25.6,25.6
S125.047,188.734,110.933,188.734z"
/>
<polygon points="396.067,137.534 344.867,188.734 389.001,188.734 440.201,137.534 " />
<path d="M495.625,137.534h-31.292l-51.2,51.2h82.492c9.028,0,16.375-7.347,16.375-16.375v-18.449
C512.001,144.881,504.654,137.534,495.625,137.534z"
/>
</g>
</g>
</g>
</svg>
);
}

export function GateIcon(props: any) {
return <Icon component={GateSvg} {...props} />;
}
17 changes: 17 additions & 0 deletions src/icons/house.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* eslint-disable max-len,react/jsx-props-no-spreading */
import React from 'react';
import Icon from '@ant-design/icons';

function HouseSvg() {
return (
<svg viewBox="0 0 576 512" fill="currentColor">
<path
d="M575.8 255.5C575.8 273.5 560.8 287.6 543.8 287.6H511.8L512.5 447.7C512.5 450.5 512.3 453.1 512 455.8V472C512 494.1 494.1 512 472 512H456C454.9 512 453.8 511.1 452.7 511.9C451.3 511.1 449.9 512 448.5 512H392C369.9 512 352 494.1 352 472V384C352 366.3 337.7 352 320 352H256C238.3 352 224 366.3 224 384V472C224 494.1 206.1 512 184 512H128.1C126.6 512 125.1 511.9 123.6 511.8C122.4 511.9 121.2 512 120 512H104C81.91 512 64 494.1 64 472V360C64 359.1 64.03 358.1 64.09 357.2V287.6H32.05C14.02 287.6 0 273.5 0 255.5C0 246.5 3.004 238.5 10.01 231.5L266.4 8.016C273.4 1.002 281.4 0 288.4 0C295.4 0 303.4 2.004 309.5 7.014L564.8 231.5C572.8 238.5 576.9 246.5 575.8 255.5L575.8 255.5z"
/>
</svg>
);
}

export function HouseIcon(props: any) {
return <Icon component={HouseSvg} {...props} />;
}
9 changes: 5 additions & 4 deletions src/layout/footer/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

.ant-menu-item {
text-align: center;
line-height: 18px;
line-height: 20px;

.anticon.ant-menu-item-icon {
font-size: 18px;
font-size: 20px;
}

&::after {
Expand All @@ -30,8 +31,8 @@
color: inherit;
margin: 0;
padding-top: 0.5em;
line-height: 12px;
font-size: 12px;
line-height: 14px;
font-size: 14px;
}

&:not(.ant-menu-item-selected) {
Expand Down
3 changes: 2 additions & 1 deletion src/navigation/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { UserProfile } from '../views/user/profile';
import { GrantedAccesses } from '../views/user/accesses';
import { EnumUserRequestRole } from '../backend';
import { NavigationMenuItemType } from './types';
import { GateIcon } from '../icons/gate';

export const NavigationItems: NavigationMenuItemType[] = [
{
key: '/granted-accesses',
icon: <LockOutlined />,
icon: <GateIcon />,
title: 'Доступы',
component: <GrantedAccesses />,
roles: [EnumUserRequestRole.USER],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ $areasWidth: 52px;
gap: 6px;
line-height: 16px;
min-height: 36px;
padding-top: 2px;

.access-area {
.anticon {
font-size: 19px;
font-size: 21px;

&.leaf-icon {
//color: #61a938;
Expand All @@ -26,8 +27,8 @@ $areasWidth: 52px;
text-align: center;

.place {
font-size: 14px;
line-height: 15px;
font-size: 15px;
line-height: 18px;
color: rgba(90, 90, 90, 0.8);
}

Expand Down
14 changes: 7 additions & 7 deletions src/views/user/accesses/access-item/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
align-items: flex-end;
gap: 1em;

&:first-child {
margin-top: 1.5em;
}
//&:first-child {
// margin-top: 1.5em;
//}

&:not(:last-child) {
padding-bottom: 6px;
Expand All @@ -20,7 +20,7 @@
flex: 1 0 auto;
display: flex;
align-items: flex-start;
gap: 1.5em;
gap: 0.5em;

.access-user-info {
.phone-number-container {
Expand All @@ -30,8 +30,8 @@
.phone-number {
position: relative;
display: inline-block;
font-size: 16px;
line-height: 16px;
font-size: 18px;
line-height: 18px;
font-weight: 500;
white-space: nowrap;

Expand Down Expand Up @@ -60,7 +60,7 @@

.phone-label {
color: gray;
line-height: 14px;
line-height: 16px;

&.has-label {
color: $grayDark;
Expand Down
26 changes: 22 additions & 4 deletions src/views/user/accesses/index.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
import React, { useEffect, useState } from 'react';
import React, { useMemo } from 'react';
import { useSelector } from 'react-redux';
import { Spin, Typography } from 'antd';
import { LoadingOutlined } from '@ant-design/icons';
import { ParkingFilledIcon } from 'icons/parking_filled';
import { TreeFilledIcon } from 'icons/tree-filled';
import { getAccesses } from 'store/accesses/selectors';
import { AccessItem } from './access-item';
import './styles.scss';

export function GrantedAccesses() {
const { data: accesses, isLoading } = useSelector(getAccesses);
const {
data: accesses,
isLoading
} = useSelector(getAccesses);

const hasTwoIconsItem = useMemo(() => accesses.some((access) => (access.areas || []).length > 1), [accesses.length]);
return (
<div className="view granted-accesses">
{/* <Typography.Title level={5}>Доступы</Typography.Title> */}
<Typography.Title level={5}>Ваши доступы</Typography.Title>
{isLoading && <Spin indicator={<LoadingOutlined spin />} size="small" />}
<div className="access-list">
<div className={`access-list ${hasTwoIconsItem ? '' : 'single-area'}`}>
{
accesses.length ? accesses.map((access) => <AccessItem key={access.accessId} access={access} />)
: (isLoading ? '' : 'нет доступов')
}
</div>
<div className="area-icons-placeholder">
{/* todo брать арии из справочника */}
*
<div className="area parking">
<ParkingFilledIcon />
<span className="icon-label"> - Паркинг</span>
</div>
<div className="area home">
<TreeFilledIcon />
<span className="icon-label"> - Дворовая территория</span>
</div>
</div>
</div>
);
}
39 changes: 39 additions & 0 deletions src/views/user/accesses/styles.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
.view.granted-accesses {
display: flex;
flex-flow: column;


padding: 0.5em 0 0.5em 0 !important;


h5 {
margin-bottom: 1em;
}

> .access-list {
padding-left: 0.5em;
padding-right: 0.5em;
text-align: start;
flex: 1 0 auto;
max-height: calc(100% - 32px - 40px);
overflow-y: auto;

&.single-area {
.access-item-areas {
width: 26px;
}
}


}

.area-icons-placeholder {
height: 32px;
display: flex;
background: rgba(230, 244, 255, 0.5);
padding: 2px 8px;
align-items: center;
justify-content: flex-start;
gap: 1em;

.anticon.anticon-info {
font-size: 14px;
color: rgba(150, 150, 150, .9);
}
}
}
Loading

0 comments on commit c7a0e87

Please sign in to comment.