-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
2,468 additions
and
687 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import {Route} from "atomic-router-react"; | ||
import {routes} from "../api"; | ||
import {Registration, Home} from "@/pages"; | ||
import {Registration, Home, Main} from "@/pages"; | ||
|
||
export const Routes = () => ( | ||
<> | ||
<Route route={routes.home} view={Home}/> | ||
<Route route={routes.registration} view={Registration}/> | ||
<Route route={routes.main} view={Main}/> | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {AddPictureButton} from "./ui/AddPictureButton.tsx" |
34 changes: 34 additions & 0 deletions
34
frontend/src/entities/add-picture-button/ui/AddPictureButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import {Icon28AddCircle} from "@telegram-apps/telegram-ui/dist/icons/28/add_circle"; | ||
import {Card} from "@telegram-apps/telegram-ui"; | ||
import {ChangeEventHandler} from "react"; | ||
|
||
interface addPictureButtonProps { | ||
handleUploadingPhotos: ChangeEventHandler<any> | ||
} | ||
export const AddPictureButton = ({handleUploadingPhotos}: addPictureButtonProps) => ( | ||
<Card style={{ | ||
background: 'var(--tgui--secondary_bg_color)', | ||
display: "block" | ||
}}> | ||
<Icon28AddCircle style={{ | ||
display: "block", | ||
margin: "auto", | ||
// marginRight: "auto", | ||
marginBottom: "50%", | ||
marginTop: "50%", | ||
transform: "scale(5)" | ||
}} mode="plain"/> | ||
<input type="file" multiple accept="image/*" onInput={handleUploadingPhotos} style={{ | ||
display: "block", | ||
height: "100%", | ||
width: "100%", | ||
position: "absolute", | ||
top: "0", | ||
bottom: "0", | ||
left: "0", | ||
right: "0", | ||
opacity: "0", | ||
cursor: "pointer" | ||
}}/> | ||
</Card> | ||
) |
13 changes: 13 additions & 0 deletions
13
frontend/src/entities/back-button/api/backButtonOnClick.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {backButton, offBackButtonClick, onBackButtonClick} from "@telegram-apps/sdk"; | ||
|
||
export function setBackButtonOnClick(fn: VoidFunction) { | ||
if (backButton.isMounted()) { | ||
return onBackButtonClick(fn) | ||
} else return () => {} | ||
} | ||
|
||
export function removeBackButtonOnClick(fn: VoidFunction) { | ||
if (backButton.isMounted()) { | ||
offBackButtonClick(fn) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {backButton} from "@telegram-apps/sdk"; | ||
|
||
export function mountBackButton() { | ||
if (backButton.mount.isAvailable()) { | ||
backButton.mount() | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
frontend/src/entities/back-button/api/setBackButtonVisible.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {backButton} from "@telegram-apps/sdk"; | ||
|
||
export function setBackButtonVisible(isVisible: boolean) { | ||
if (backButton.isMounted()) { | ||
if (backButton.isSupported()) { | ||
if (isVisible) { | ||
backButton.show() | ||
} else { | ||
backButton.hide() | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export {setBackButtonVisible} from "./api/setBackButtonVisible.ts" | ||
export {mountBackButton} from "./api/mountBackButton.ts" |
18 changes: 18 additions & 0 deletions
18
frontend/src/entities/main-button/api/mainButtonOnClick.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {mainButton, offMainButtonClick, onMainButtonClick} from "@telegram-apps/sdk"; | ||
|
||
export function setMainButtonOnClick(fn: VoidFunction) { | ||
if (mainButton.isMounted()) { | ||
return onMainButtonClick(fn) | ||
} else return () => {} | ||
} | ||
|
||
export function removeMainButtonOnClick(fn: VoidFunction) { | ||
if (mainButton.isMounted()) { | ||
offMainButtonClick(fn) | ||
} | ||
} | ||
|
||
export function setMainButtonOnAndOffClick(fn: VoidFunction) { | ||
const fun = () => {fn(); removeMainButtonOnClick(fun)} | ||
setMainButtonOnClick(fun) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {mainButton} from "@telegram-apps/sdk"; | ||
|
||
export function mountMainButton() { | ||
if (mainButton.mount.isAvailable()) { | ||
mainButton.mount() | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
frontend/src/entities/main-button/api/setMainButtonParams.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {mainButton} from "@telegram-apps/sdk"; | ||
|
||
export function setMainButtonParams( | ||
text: string, | ||
hasShineEffect: boolean, | ||
isEnabled: boolean, | ||
) { | ||
if (mainButton.isMounted()) { | ||
if (mainButton.setParams.isAvailable()) { | ||
mainButton.setParams({ | ||
text: text, | ||
isEnabled: isEnabled, | ||
hasShineEffect: hasShineEffect, | ||
}); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
frontend/src/entities/main-button/api/setMainButtonVisible.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {mainButton} from "@telegram-apps/sdk"; | ||
|
||
export function setMainButtonVisible(isVisible: boolean) { | ||
if (mainButton.isMounted()) { | ||
if (mainButton.setParams.isAvailable()) { | ||
mainButton.setParams({ | ||
isVisible: isVisible | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export {setMainButtonVisible} from "./api/setMainButtonVisible.ts" | ||
export {setMainButtonParams} from "./api/setMainButtonParams.ts" | ||
export {mountMainButton} from "./api/mountMainButton.ts" | ||
export {setMainButtonOnClick, setMainButtonOnAndOffClick, removeMainButtonOnClick} from "./api/mainButtonOnClick.ts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export interface PersonPatch { | ||
status: string, | ||
firstName: string, | ||
lastName: string, | ||
interests: Topic[], | ||
height: number, | ||
birthday: string, | ||
facultyId: number, | ||
locationId: number | ||
} | ||
|
||
export interface Topic { | ||
topicId: number, | ||
level: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface Coordinates { | ||
latitude: number, | ||
longitude: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {Topic} from "@/entities/person/model/Topic.ts"; | ||
|
||
export interface Interest { | ||
topic: Topic | ||
level: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {Coordinates} from "./Coordinates.ts"; | ||
|
||
export interface Location { | ||
name: string, | ||
coordinates: Coordinates | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {Picture} from "./Picture.ts"; | ||
import {Interest} from "./Interest.ts"; | ||
import {Location} from "./Location.ts"; | ||
|
||
export interface Person { | ||
id: number, | ||
zodiac: string, | ||
updateMoment: Date, | ||
firstName: string, | ||
lastName: string, | ||
pictures: Picture[], | ||
interests: Interest[], | ||
height: number, | ||
birthday: Date, | ||
faculty: string, | ||
location: Location | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface Picture { | ||
id: number, | ||
small: string, | ||
medium: string, | ||
large: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {Picture} from "./Picture.ts"; | ||
|
||
export interface Topic { | ||
id: number, | ||
name: string, | ||
icon: Picture, | ||
color: string | ||
} |
6 changes: 6 additions & 0 deletions
6
frontend/src/entities/registration-data/model/RegistartionData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import {Interest} from "./interest.ts"; | ||
import {Picture} from "./picture.ts"; | ||
|
||
export type RegistrationData = { | ||
tgId: string; | ||
name: string; | ||
surname: string; | ||
height: number; | ||
faculty: string; | ||
birthday: Date; | ||
pictures: Picture[], | ||
interests: Interest[] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface Interest { | ||
topicId: number, | ||
level: number, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface Picture { | ||
id: number, | ||
small: string, | ||
medium: string, | ||
large: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface Topic { | ||
id: number, | ||
name: string, | ||
icon: any, | ||
color: any | ||
} |
33 changes: 33 additions & 0 deletions
33
frontend/src/entities/registration-person-draft/model/PersonDraft.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export interface PersonDraft { | ||
firstName: string, | ||
lastName: string, | ||
pictures: Picture[], | ||
interests: Interest[], | ||
height: number, | ||
birthday: Date, | ||
faculty: string, | ||
location: Location | ||
} | ||
|
||
interface Picture { | ||
id: number, | ||
small: string, | ||
medium: string | null, | ||
large: string | null | ||
} | ||
|
||
interface Interest { | ||
topicId: number, | ||
level: number | ||
} | ||
|
||
interface Location { | ||
name: string, | ||
coordinates: Coordinates | ||
|
||
} | ||
|
||
interface Coordinates { | ||
latitude: number, | ||
longitude: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {RegistrationPictureElement} from "./ui/RegistrationPictureElement.tsx" |
Oops, something went wrong.