Skip to content

Commit

Permalink
modal (#136)
Browse files Browse the repository at this point in the history
* modal

* search sity

* fix locationSearchString map

* input

* coordinats

* locatin cord map

* type locatio fix

* props selectl cords

* api onFinish

* do refactor

* Refactor and fix geo locale

* state adress cord

* map cord open

* state

* geolocation user

* fix geo and styles map

* fix useEffect array

* fin test

* no duble adres cordinates

* antd fix

* duble finish

* remove empty array

* fix useEffect

* sts blog

* Fix logic

---------

Co-authored-by: Vadim Tokar <[email protected]>
  • Loading branch information
korobprog and vraja-nayaka authored Dec 23, 2024
1 parent 050a74a commit 88ac33d
Show file tree
Hide file tree
Showing 9 changed files with 408 additions and 48 deletions.
84 changes: 76 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,20 @@
],
"dependencies": {
"@ant-design/pro-layout": "^7.17.6",
"@pbe/react-yandex-maps": "^1.2.5",
"exceljs": "^4.3.0",
"file-saver": "^2.0.5",
"i18next": "^23.10.0",
"jspdf": "^2.5.1",
"react-yandex-maps": "^4.6.0",
"i18next": "^23.10.0",
"react-i18next": "^14.1.0"
},
"devDependencies": {
"@types/firebase": "^3.2.1",
"@types/lodash": "^4.14.202",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@yandex/ymaps3-types": "^0.0.28",
"craco-plugin-env": "^1.0.5",
"firebase": "^9.23.0",
"husky": "^8.0.3",
Expand Down
16 changes: 15 additions & 1 deletion packages/admin/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,27 @@ import { LocaleProvider } from "common/src/app/locale-provider/LocaleProvider";
import "./i18n";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import { YMaps } from "react-yandex-maps";
import { ConfigProvider } from "antd";
import ru_RU from "antd/locale/ru_RU";

ReactDOM.render(
<React.StrictMode>
<BrowserRouter>
<Offline>
<LocaleProvider>
<App />
<ConfigProvider locale={ru_RU}>
<YMaps
query={{
apikey: process.env.REACT_APP_YMAP_KEY,
// @ts-ignore
suggest_apikey: process.env.REACT_APP_YMAPGEO_KEY,
lang: "ru_RU",
}}
>
<App />
</YMaps>
</ConfigProvider>
</LocaleProvider>
</Offline>
</BrowserRouter>
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/components/HolderTransferList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { $booksHashMap } from "common/src/services/books/index";
import { WithId } from "../services/api/refs";
import { getBookDeclensions, getTypeDeclensions } from "../utils/declension";
import { calcBooksCounts } from "./forms/stock/helpers";
import React from "react";

const displayedTransersCount = 3;

Expand Down
22 changes: 17 additions & 5 deletions packages/common/src/components/LocationSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ type LocationSelectProps = SelectProps & {
locationSearchString: string;
isOnline?: boolean;
loading?: boolean;
onAddLocation: (location: string) => void;
};

export const LocationSelect = React.forwardRef<RefSelectProps, LocationSelectProps>(
(props, ref) => {
const { onAddNewLocation, locationSearchString, children, isOnline, loading, ...restProps } =
props;
const {
onAddNewLocation,
onAddLocation,
locationSearchString,
children,
isOnline,
loading,
...restProps
} = props;

return (
<Select
Expand All @@ -32,9 +40,13 @@ export const LocationSelect = React.forwardRef<RefSelectProps, LocationSelectPro
</Typography.Paragraph>

{isOnline ? (
<Typography.Link onClick={onAddNewLocation} style={{ whiteSpace: "nowrap" }}>
<PlusOutlined />
Добавить "{locationSearchString}"
<Typography.Link
onClick={() => {
onAddLocation(locationSearchString);
}}
style={{ whiteSpace: "nowrap" }}
>
<PlusOutlined /> Добавить "{locationSearchString}"
</Typography.Link>
) : (
<Typography.Text>
Expand Down
Loading

0 comments on commit 88ac33d

Please sign in to comment.