Browse Source

add contacts

main
matthew 2 years ago
parent
commit
23b08d96a7
  1. 26
      searching-front/app/core/components/Footer/Footer.tsx
  2. 4
      searching-front/app/core/components/Footer/TGLogo.tsx
  3. 1
      searching-front/app/core/components/Footer/index.ts
  4. 16
      searching-front/app/core/components/Footer/styles.module.css
  5. 2
      searching-front/app/core/layouts/Layout/index.tsx
  6. 3
      searching-front/app/core/layouts/Layout/styles.module.css
  7. 1
      searching-front/app/i18n/en.ts
  8. 2
      searching-front/app/i18n/index.ts
  9. 1
      searching-front/app/i18n/ru.ts
  10. 3
      searching-front/pages/index.tsx
  11. 2
      searching-front/pages/s.tsx
  12. 5
      searching-front/services/modules/parser/index.ts
  13. 2
      searching-front/services/parser.ts

26
searching-front/app/core/components/Footer/Footer.tsx

@ -0,0 +1,26 @@
import { Routes } from "@blitzjs/next"
import TonLogo from "app/core/icons/TonLogo"
import { useRouter } from "next/router"
import { useTranslation } from "react-i18next"
import SearchForm from "../SearchForm"
import ThemeSwitcher from "../ThemeSwitcher/ThemeSwitcher"
import s from "./styles.module.css"
import TGLogo from "./TGLogo"
const Header = () => {
const { route } = useRouter()
const router = useRouter()
const { t } = useTranslation()
return (
<div className={s.root}>
<div className={s.contactsWrapper} >
<span>{t("footer.contacts-description")}</span>
<a target="_blank" href="https://searching_ton.t.me/"><TGLogo className={s.tgIcon}/></a>
</div>
</div>
)
}
export default Header

4
searching-front/app/core/components/Footer/TGLogo.tsx

@ -0,0 +1,4 @@
export default function ({className}) {
return <svg className={className} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 159 159"><defs><linearGradient id="a" x1="481.03" y1="545.05" x2="481.03" y2="544.89" gradientTransform="matrix(1000 0 0 -1000 -480951.5 545048.5)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2aabee"/><stop offset="1" stop-color="#229ed9"/></linearGradient></defs><circle cx="79.5" cy="79.5" r="79.5" fill="url(#a)"/><path d="M468.49 511.16q34.76-15.15 46.36-20c22.08-9.18 26.67-10.78 29.66-10.83a5.23 5.23 0 0 1 3.08.92 3.35 3.35 0 0 1 1.13 2.15 14 14 0 0 1 .13 3.13c-1.2 12.57-6.37 43.08-9 57.16-1.11 6-3.31 8-5.43 8.15-4.62.42-8.12-3.05-12.59-6-7-4.59-10.95-7.44-17.74-11.92-7.85-5.17-2.76-8 1.71-12.66 1.17-1.22 21.51-19.72 21.91-21.4a1.62 1.62 0 0 0-.37-1.41 1.83 1.83 0 0 0-1.65-.16q-1.05.24-33.53 22.16-4.76 3.27-8.62 3.18c-2.84-.06-8.3-1.6-12.36-2.92-5-1.62-8.94-2.47-8.59-5.22q.25-2.08 5.9-4.33Z" transform="translate(-432.5 -432.5)" fill="#fff"/></svg>
}

1
searching-front/app/core/components/Footer/index.ts

@ -0,0 +1 @@
export {default} from './Footer'

16
searching-front/app/core/components/Footer/styles.module.css

@ -0,0 +1,16 @@
.root {
box-sizing: border-box;
display: flex;
justify-content: center;
}
.tgIcon {
width: 25px;
height: 25px;
margin-top: 10px;
}
.contactsWrapper {
display: flex;
flex-direction: column;
align-items: center;
color: var(--text_secondary);
}

2
searching-front/app/core/layouts/Layout/index.tsx

@ -5,6 +5,7 @@ import s from "./styles.module.css"
import Header from "app/core/components/Header"
import { cn } from "app/core/helpers/common"
import { useCurrentTheme } from "app/core/hooks/useCurrentTheme"
import Footer from "app/core/components/Footer"
const Layout: BlitzLayout<{
title?: string
@ -28,6 +29,7 @@ const Layout: BlitzLayout<{
>
<Header />
<div className={cn(s.content, { [s.withoutPaddings]: withoutPaddings })}>{children}</div>
<Footer/>
</div>
</>
)

3
searching-front/app/core/layouts/Layout/styles.module.css

@ -1,6 +1,9 @@
.root {
background: var(--background_main);
padding: 20px;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.content {
margin-top: 20px;

1
searching-front/app/i18n/en.ts

@ -2,6 +2,7 @@ const en = {
translation: {
"search.placeholder": "Find your own ton",
"search.button": "Search",
"footer.contacts-description": "Feedback, suggestions, bug reports",
},
}

2
searching-front/app/i18n/index.ts

@ -32,7 +32,7 @@ i18n.use(initReactI18next).init({
},
fallbackLng: "en",
lng: getI18nLanguage(),
debug: true,
debug: false,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},

1
searching-front/app/i18n/ru.ts

@ -2,6 +2,7 @@ const ru = {
translation: {
"search.placeholder": "Найди свой собственный TON",
"search.button": "Найти",
"footer.contacts-description": "Отзывы, предложения, багрепорты",
},
}

3
searching-front/pages/index.tsx

@ -28,7 +28,6 @@ import {
import { gSSP } from "app/blitz-server"
const Home: BlitzPage = (props) => {
console.log("\n\n\n SERVER SIDE", props)
return (
<ErrorBoundary
FallbackComponent={ErrorFallback}
@ -37,7 +36,7 @@ const Home: BlitzPage = (props) => {
}}
>
<ServerSidePropsContext.Provider value={props}>
<Layout title="Home" withoutPaddings>
<Layout title="Searching" withoutPaddings>
<Suspense fallback="Loading...">
<Main />
</Suspense>

2
searching-front/pages/s.tsx

@ -36,7 +36,7 @@ const SearchPage: BlitzPage = (props) => {
}}
>
<ServerSidePropsContext.Provider value={props}>
<Layout title="Home">
<Layout title="Searching">
<Suspense fallback="Loading...">
<Search />
</Suspense>

5
searching-front/services/modules/parser/index.ts

@ -28,13 +28,12 @@ class Parser {
constructor() {}
parseUrl = async (url: string) => {
try {
console.log('Send request via ton proxy ', url)
const { data, headers } = await axios.get(url,{
proxy: getTonProxy(),
})
console.log('Success response from ', url)
const contentType = headers["content-type"].toLocaleLowerCase()
console.log(contentType)
if (!contentType.startsWith('text/html')) {
return SHOULD_NOT_PARSE
}

2
searching-front/services/parser.ts

@ -11,7 +11,6 @@ const findFirstNotIndexed = (subpages: SubPages = {}) => {
}
const indexWebsite = async (domain: string, path: string, subpages: SubPages = {}) => {
console.log('Start indexWebsite ', domain)
if (!subpages[path]) {
const url = domain + path;
const parseInfo = await Parser.parseUrl(url)
@ -26,7 +25,6 @@ const indexWebsite = async (domain: string, path: string, subpages: SubPages = {
} else {
pages = subpages
}
console.log(pages)
const firstNotIndexed = findFirstNotIndexed(pages)
if (firstNotIndexed) {
return await indexWebsite(domain, firstNotIndexed, pages)

Loading…
Cancel
Save