Browse Source

Alexandria deployment landing page

Leszek Wiesner 4 years ago
parent
commit
81b559d27f

File diff suppressed because it is too large
+ 3 - 0
pioneer/packages/apps/public/Logo_Alexandrial.svg


+ 96 - 10
pioneer/packages/apps/public/index.html

@@ -18,17 +18,103 @@
       </script>
     <% } %>
     <script type="text/javascript" src="/env-config.js"></script>
+    <% if (!htmlWebpackPlugin.options.IS_LIVE) { %>
+      <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
+      <style>
+        body {
+          background: #000 !important;
+          color: #fff !important;
+          min-height: 100vh !important;
+          margin: 0 !important;
+          padding: 0 !important;
+          padding-top: 20vh !important;
+          box-sizing: border-box;
+          font-family: 'Inter', sans-serif !important;
+        }
+        header {
+          width: 100%;
+          background: #261EE4;
+        }
+        .info-flexbox {
+          display: flex;
+          width: 80%;
+          max-width: 800px;
+          margin: 0 auto;
+          align-items: flex-end;
+          padding: 20px;
+        }
+        h2 {
+          font-weight: normal !important;
+          margin-bottom: 20px;
+        }
+        .blog-link {
+          margin-left: auto;
+          color: #000 !important;
+          background: #6C6CFF;
+          padding: 10px 20px;
+          font-size: 16px;
+          text-decoration: none;
+          transition: background-color 0.2s;
+        }
+        .blog-link:hover {
+          background: #fff;
+        }
+        .box-content {
+          display: flex;
+          flex-direction: column;
+          justify-content: space-between;
+          margin-top: 20px;
+        }
+        .logo-alexandria {
+          width: 30%;
+          flex-shrink: 0;
+          margin-right: 30px;
+        }
+        @media screen and (max-width: 800px) {
+          h2 {
+            font-size: 20px !important;
+          }
+        }
+        @media screen and (max-width: 500px) {
+          body {
+            padding: 50px 0 !important;
+          }
+          .info-flexbox {
+            flex-wrap: wrap;
+          }
+          .info-flexbox > * {
+            width: 100% !important;
+          }
+        }
+      </style>
+    <% } %>
   </head>
   <body>
-    <noscript>
-      You need to enable JavaScript to run this app.
-    </noscript>
-    <div id="root"></div>
-    <div id="tooltips"></div>
-    <script>
-      if (window.self !== window.top) {
-        window.top.location.href = window.location.href;
-      }
-    </script>
+    <% if (htmlWebpackPlugin.options.IS_LIVE) { %>
+      <noscript>
+        You need to enable JavaScript to run this app.
+      </noscript>
+      <div id="root"></div>
+      <div id="tooltips"></div>
+      <script>
+        if (window.self !== window.top) {
+          window.top.location.href = window.location.href;
+        }
+      </script>
+    <% } else { %>
+      <header>
+        <div class="info-flexbox">
+          <img src="./Logo_Alexandrial.svg" class="logo-alexandria">
+          <div class="box-content">
+            <h2>
+              Our new testnet - Alexandria will be launched
+              around&nbsp;09:00&nbsp;UTC on&nbsp;Monday the&nbsp;21st
+              of&nbsp;September&nbsp;2020.
+            </h2>
+            <a href="https://blog.joystream.org/announcing-alexandria/" target="_blank" class="blog-link">Find out more</a>
+          </div>
+        </div>
+      </header>
+    <% } %>
   </body>
 </html>

+ 1 - 0
pioneer/packages/apps/src/notLive.ts

@@ -0,0 +1 @@
+// Empty entry point for webpack if not in live mode to speed up the build

+ 3 - 1
pioneer/packages/apps/webpack.base.config.js

@@ -27,6 +27,7 @@ function mapChunks (name, regs, inc) {
 function createWebpack (ENV, context) {
   const pkgJson = require(path.join(context, 'package.json'));
   const isProd = ENV === 'production';
+  const isLive = !(process.env.IS_LIVE === 'false' || process.env.IS_LIVE === false);
   const hasPublic = fs.existsSync(path.join(context, 'public'));
   const plugins = hasPublic
     ? [new CopyWebpackPlugin({ patterns: [{ from: 'public' }] })]
@@ -53,7 +54,8 @@ function createWebpack (ENV, context) {
 
   return {
     context,
-    entry: ['@babel/polyfill', './src/index.tsx'],
+    // Make it quicker if we're not in a LIVE mode
+    entry: !isLive ? './src/notLive.ts' : ['@babel/polyfill', './src/index.tsx'],
     mode: ENV,
     module: {
       rules: [

+ 2 - 0
pioneer/packages/apps/webpack.config.js

@@ -11,6 +11,7 @@ const baseConfig = require('./webpack.base.config');
 const HtmlWebpackPlugin = require('html-webpack-plugin');
 
 const ENV = process.env.NODE_ENV || 'development';
+const IS_LIVE = !(process.env.IS_LIVE === false || process.env.IS_LIVE === 'false');
 const context = __dirname;
 const hasPublic = fs.existsSync(path.join(context, 'public'));
 
@@ -21,6 +22,7 @@ module.exports = merge(
     plugins: [
       new HtmlWebpackPlugin({
         IS_PROD: ENV === 'production',
+        IS_LIVE,
         PAGE_TITLE: 'Joystream Network Portal',
         inject: true,
         template: path.join(context, `${hasPublic ? 'public/' : ''}index.html`)

+ 8 - 2
pioneer/scripts/dev-build-ts.js

@@ -12,6 +12,7 @@ const cpx = require('cpx');
 const fs = require('fs');
 const mkdirp = require('mkdirp');
 const path = require('path');
+const IS_LIVE = !(process.env.IS_LIVE === false || process.env.IS_LIVE === 'false');
 
 const CPX = ['css', 'gif', 'hbs', 'jpg', 'js', 'png', 'svg', 'd.ts']
   .map((ext) => `src/**/*.${ext}`)
@@ -55,7 +56,8 @@ async function buildJs (dir) {
 
     if (fs.existsSync(path.join(process.cwd(), 'public'))) {
       buildWebpack(dir);
-    } else {
+      // Skip building anything else if we're not going for a LIVE build
+    } else if (IS_LIVE) {
       await buildBabel(dir);
     }
 
@@ -66,6 +68,8 @@ async function buildJs (dir) {
 async function main () {
   execSync('yarn polkadot-dev-clean-build');
 
+  console.log('IS_LIVE:', process.env.IS_LIVE);
+
   // By default the entry point is pioneer/, so here we move to pioneer/packages
   process.chdir('packages');
 
@@ -74,7 +78,9 @@ async function main () {
   // This caused the build folder to end up in the root directory of the monorepo (instead of "pioneer/build")
   //
   // execSync('yarn polkadot-exec-tsc --emitDeclarationOnly --outdir ../build');
-  execSync('yarn tsc --emitDeclarationOnly --outdir ./build');
+  if (IS_LIVE) {
+    execSync('yarn tsc --emitDeclarationOnly --outdir ./build');
+  }
 
   const dirs = fs
     .readdirSync('.')

Some files were not shown because too many files changed in this diff