Web: ASC.Web.Campaigns: added gatsby project

This commit is contained in:
Dmitry Sychugov 2022-02-01 20:03:37 +05:00
parent 01fdb34aaa
commit 94d51d88b5
14 changed files with 531 additions and 0 deletions

View File

@ -0,0 +1,5 @@
{
"projects": {
"default": "appserver-c011a"
}
}

View File

@ -0,0 +1,3 @@
{
"defaultLanguage": "en"
}

View File

@ -0,0 +1,45 @@
const languages = require("./languages.json");
const availableLanguages = languages.map((el) => el.shortKey);
const {
defaultLanguage,
} = require("./config.json");
module.exports = {
plugins: [
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/locales`,
name: `locale`
}
},
{
resolve: `gatsby-plugin-react-i18next`,
options: {
localeJsonSourceName: `locale`,
languages: availableLanguages,
defaultLanguage,
redirect: false,
generateDefaultLanguagePage: `/en`,
i18nextOptions: {
fallbackLng: defaultLanguage,
interpolation: {
escapeValue: false
},
keySeparator: false,
nsSeparator: false
},
pages: [
{
matchPath: '/preview',
languages: [""],
},
],
}
},
'gatsby-plugin-no-javascript'
],
}

View File

@ -0,0 +1,9 @@
exports.createPages = async ({ actions }) => {
const { createPage } = actions
createPage({
path: "/using-dsg",
component: require.resolve("./src/templates/using-dsg.js"),
context: {},
defer: true,
})
}

View File

@ -0,0 +1,137 @@
[
{
"key": "az-Latn-AZ",
"shortKey": "az",
"iconName": "az.svg"
},
{
"key": "bg-BG",
"shortKey": "bg",
"iconName": "bg.svg"
},
{
"key": "zh-CN",
"shortKey": "zh",
"iconName": "zh.svg"
},
{
"key": "cs-CZ",
"shortKey": "cs",
"iconName": "cs.svg"
},
{
"key": "nl-NL",
"shortKey": "nl",
"iconName": "nl.svg"
},
{
"key": "en-GB",
"shortKey": "en-GB",
"iconName": "en-GB.svg"
},
{
"key": "en-US",
"shortKey": "en",
"iconName": "en.svg"
},
{
"key": "fi-FI",
"shortKey": "fi",
"iconName": "fi.svg"
},
{
"key": "fr-FR",
"shortKey": "fr",
"iconName": "fr.svg"
},
{
"key": "de-DE",
"shortKey": "de",
"iconName": "de.svg"
},
{
"key": "de-CH",
"shortKey": "de-CH",
"iconName": "de-CH.svg"
},
{
"key": "el-GR",
"shortKey": "el",
"iconName": "el.svg"
},
{
"key": "it-IT",
"shortKey": "it",
"iconName": "it.svg"
},
{
"key": "ja-JP",
"shortKey": "ja",
"iconName": "ja.svg"
},
{
"key": "ko-KR",
"shortKey": "ko",
"iconName": "ko.svg"
},
{
"key": "lv-LV",
"shortKey": "lv",
"iconName": "lv.svg"
},
{
"key": "pl-PL",
"shortKey": "pl",
"iconName": "pl.svg"
},
{
"key": "pt-BR",
"shortKey": "pt-BR",
"iconName": "pt-BR.svg"
},
{
"key": "pt-PT",
"shortKey": "pt",
"iconName": "pt.svg"
},
{
"key": "ru-RU",
"shortKey": "ru",
"iconName": "ru.svg"
},
{
"key": "sk-SK",
"shortKey": "sk",
"iconName": "sk.svg"
},
{
"key": "sl-SI",
"shortKey": "sl",
"iconName": "sl.svg"
},
{
"key": "es-MX",
"shortKey": "es-MX",
"iconName": "es-MX.svg"
},
{
"key": "es-ES",
"shortKey": "es",
"iconName": "es.svg"
},
{
"key": "tr-TR",
"shortKey": "tr",
"iconName": "tr.svg"
},
{
"key": "uk-UA",
"shortKey": "uk",
"iconName": "uk.svg"
},
{
"key": "vi-VN",
"shortKey": "vi",
"iconName": "vi.svg"
}
]

View File

@ -0,0 +1,49 @@
{
"name": "gatsby-starter-default",
"private": true,
"description": "A simple starter to get up and developing quickly with Gatsby",
"version": "0.1.0",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": {
"gatsby": "^4.4.0",
"gatsby-plugin-gatsby-cloud": "^4.4.0",
"gatsby-plugin-image": "^2.4.0",
"gatsby-plugin-manifest": "^4.4.0",
"gatsby-plugin-no-javascript": "^2.0.5",
"gatsby-plugin-offline": "^5.4.0",
"gatsby-plugin-react-helmet": "^5.4.0",
"gatsby-plugin-react-i18next": "^1.2.2",
"gatsby-plugin-sharp": "^4.4.0",
"gatsby-source-filesystem": "^4.4.0",
"gatsby-transformer-sharp": "^4.4.0",
"i18next": "^21.6.5",
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"react-i18next": "^11.15.3"
},
"devDependencies": {
"prettier": "^2.4.1"
},
"keywords": [
"gatsby"
],
"license": "0BSD",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
"start": "gatsby develop",
"serve": "gatsby serve",
"clean": "gatsby clean",
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
},
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
}
}

View File

@ -0,0 +1,4 @@
{
"Title":"ONLYOFFICE Advent Calendar",
"Text": "Spend 24 days of Christmas with ONLYOFFICE. Get <1>new gifts and discounts</1> each day - up to 99% off!"
}

View File

@ -0,0 +1,4 @@
{
"Title":"Адвент-календарь ONLYOFFICE",
"Text": "Готовьтесь к Новому году с ONLYOFFICE и получите <1>ежедневные подарки и скидки</1> каждый день - до минус 99%!"
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 285 KiB

View File

@ -0,0 +1,28 @@
div {
text-align: center;
}
.wrapper {
max-width: 100%;
}
@media (max-width: 992px) {
.text {
font-size: 16px;
}
}
@media (max-width: 768px) {
.text {
font-size: 14px;
}
}
@media (max-width: 476px) {
.text {
font-size: 12px;
}
.content-box {
padding: 0 10px;
}
}

View File

@ -0,0 +1,53 @@
import * as React from "react"
import { graphql } from "gatsby";
import {Trans, useTranslation} from 'gatsby-plugin-react-i18next';
import logo from "./images/santa.svg"
import '../../styles/base.css';
import "./index.css";
const IndexPage = () => {
const {t, i18n: { language }} = useTranslation("NewYear");
const origin = "https://www.onlyoffice.com";
const route = "advent-calendar.aspx"
const LinkHref =`${origin}/${language === "en" ? route : `${language}/${route}`}`;
return (
<div>
<div className="wrapper" style={{display:"flex", margin: "0 auto", backgroundColor: "#266281", minHeight: "60px"}}>
<img src={logo} width={60}/>
<div className="content-box" style={{backgroundColor:"#266281", color: "#fff", display: "flex", justifyContent: "center", flexDirection: "column", margin: "0 auto", fontSize: "18px"}}>
<p>
{t("Title")}
</p>
<p className="text" style={{padding: "0", margin: "0", paddingLeft: "10px", paddingRight: "10px"}}>
<Trans i18nKey="Text">Get <a target="_blank" style={{color: "#fc9f06"}}
href={LinkHref}>new gifts and discounts</a>each day - up to 99% off!</Trans>
</p>
</div>
</div>
</div>
)
}
export default IndexPage
export const query = graphql`
query ($language: String!) {
locales: allLocale(filter: {language: {eq: $language}}) {
edges {
node {
ns
data
language
}
}
}
}
`;

View File

@ -0,0 +1,6 @@
import * as React from "react"
export default function Component () {
return "";
}

View File

@ -0,0 +1,5 @@
p,
body {
margin: 0px;
padding: 0px;
}

View File

@ -0,0 +1,20 @@
import * as React from "react"
import { Link } from "gatsby"
const UsingDSG = () => (
<div>
<h1>Hello from a DSG Page</h1>
<p>This page is not created until requested by a user.</p>
<p>
To learn more, head over to our{" "}
<a href="https://www.gatsbyjs.com/docs/reference/rendering-options/deferred-static-generation/">
documentation about Deferred Static Generation
</a>
.
</p>
<Link to="/">Go back to the homepage</Link>
</div>
)
export default UsingDSG