Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
API_URL=http://localhost:3000/api
SOCKET_URL=http://localhost:3000
2 changes: 2 additions & 0 deletions client/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
API_URL=https://server.feednext.io/api
SOCKET_URL=https://server.feednext.io
14 changes: 2 additions & 12 deletions client/config/constants.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
// APP
export const API_URL = process.env.NODE_ENV === 'production' ? 'https://server.feednext.io/api' : 'http://localhost/api'
export const SOCKET_URL = process.env.NODE_ENV === 'production' ? 'https://server.feednext.io' : 'http://localhost'

// ROLES
export const Guest = -1
export const User = 0
export const JuniorAuthor = 1
export const MidLevelAuthor = 2
export const SeniorAuthor = 3
export const Admin = 4
export const SuperAdmin = 5
export const API_URL = process.env.API_URL
export const SOCKET_URL = process.env.SOCKET_URL
12 changes: 12 additions & 0 deletions client/i18n.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import NextI18Next from "next-i18next";

const NextI18NextInstance = new NextI18Next({
defaultLanguage: "en",
defaultNS: "loginPage",
otherLanguages: ["tr"],
localePath: typeof window === "undefined" ? "public/locales" : "locales"
})

export const { appWithTranslation, withTranslation } = NextI18NextInstance

export default NextI18NextInstance;
11 changes: 10 additions & 1 deletion client/next.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
const webpack = require('webpack')

const withCSS = require('@zeit/next-css')
const withLess = require('@zeit/next-less')
const lessToJS = require('less-vars-to-js')

const fs = require('fs')
const path = require('path')
const themeVariables = lessToJS(fs.readFileSync(path.resolve(__dirname, './src/styles/antd/override.less'), 'utf8'))
const themeVariables = lessToJS(fs.readFileSync(path.resolve(__dirname, './config/override.less'), 'utf8'))

const { nextI18NextRewrites } = require('next-i18next/rewrites')
const localeSubpaths = {}

module.exports = withCSS(withLess({
rewrites: async () => nextI18NextRewrites(localeSubpaths),
publicRuntimeConfig: {
localeSubpaths,
},
lessLoaderOptions: {
javascriptEnabled: true,
modifyVars: themeVariables // make your antd custom effective
Expand Down
Loading