Skip to content

Commit

Permalink
askbot-chat-frontend-main — init web view for chat, synced http api v…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
yuriy-vorontsov committed Dec 15, 2023
1 parent ee6ab46 commit 9897081
Show file tree
Hide file tree
Showing 32 changed files with 969 additions and 0 deletions.
36 changes: 36 additions & 0 deletions askbot-chat-frontend-main/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
5 changes: 5 additions & 0 deletions askbot-chat-frontend-main/.idea/.gitignore

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

12 changes: 12 additions & 0 deletions askbot-chat-frontend-main/.idea/askbot-chat-frontend.iml

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

15 changes: 15 additions & 0 deletions askbot-chat-frontend-main/.idea/git_toolbox_prj.xml

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

8 changes: 8 additions & 0 deletions askbot-chat-frontend-main/.idea/modules.xml

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

6 changes: 6 additions & 0 deletions askbot-chat-frontend-main/.idea/vcs.xml

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

36 changes: 36 additions & 0 deletions askbot-chat-frontend-main/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
4 changes: 4 additions & 0 deletions askbot-chat-frontend-main/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}

module.exports = nextConfig
29 changes: 29 additions & 0 deletions askbot-chat-frontend-main/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "askbot-chat-frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"axios": "^1.6.2",
"classnames": "^2.3.2",
"next": "14.0.3",
"react": "^18",
"react-dom": "^18",
"react-link-parser": "^1.1.6",
"sass": "^1.69.5"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
}
6 changes: 6 additions & 0 deletions askbot-chat-frontend-main/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
40 changes: 40 additions & 0 deletions askbot-chat-frontend-main/public/icons/Education.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from "react";

import s from "./Education.module.scss";
import {RichText} from "@/components/RichText/RichText";
import Image from "next/image";
import BigInfoBlock from "@/components/BigInfoBlock";
import BulletsList from "@/components/BulletsList";

type Props = {
title: string;
icon?: string;
bullets?: string[];
description?: string;
price?: string;
};

const Education = ({ bullets, description, price, icon, title }: Props) => {
return (
<div className={s.root}>
<div className={"flex gap-2 items-center"}>
{!!icon && <Image src={icon} width={24} height={24}
alt={`Необходимые документы ${title}`}
/>}
<h5 className={"h35_style text-black"}>{title || ""}</h5>
</div>
{!!description && <RichText markdown={description } className={"mt-0"}/>}
{!!price &&
<BigInfoBlock title={"Стоимость"} value={price} isFrom={false} className={"sm:max-w-[320px]"} />
}
{!!bullets?.length &&
<>
<h6 className={"h35_style text-black"}>Необходимые документы</h6>
<BulletsList array={bullets}/>
</>
}
</div>
);
};

export default Education;
4 changes: 4 additions & 0 deletions askbot-chat-frontend-main/public/icons/arrow-up-right.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions askbot-chat-frontend-main/public/icons/askLogoXS.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions askbot-chat-frontend-main/public/icons/botAvatar.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions askbot-chat-frontend-main/public/icons/importantToKnow.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions askbot-chat-frontend-main/public/icons/userAvatar.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions askbot-chat-frontend-main/public/next.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions askbot-chat-frontend-main/public/vercel.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added askbot-chat-frontend-main/src/app/favicon.ico
Binary file not shown.
27 changes: 27 additions & 0 deletions askbot-chat-frontend-main/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
}
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}
23 changes: 23 additions & 0 deletions askbot-chat-frontend-main/src/app/hooks/useWindowDimensions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { useState, useEffect } from 'react';

export const useWindowDimensions = () => {

const [width, setWidth] = useState(0)
const [height, setHeight] = useState(0)

const handleWindowResize = () => {
setWidth(window.innerWidth);
setHeight(window.innerHeight);
}

useEffect(() => {
handleWindowResize();
window.addEventListener('resize', handleWindowResize);
return () => window.removeEventListener('resize', handleWindowResize);
}, []);

return {
width,
height
}
};
22 changes: 22 additions & 0 deletions askbot-chat-frontend-main/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'

const inter = Inter({ subsets: ['latin'] })

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
}

export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
)
}

0 comments on commit 9897081

Please sign in to comment.