Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

feature: Advanced Settings > Custom CSS (#386)

Guilherme Oenningad0e3bd45928
diff --git a/GUIDELINES.md b/GUIDELINES.md
new file mode 100644
index 000000000..548b70163
--- /dev/null
+++ b/GUIDELINES.md
@@ -0,0 +1,37 @@
+# Server Development
+
+...
+
+# UI Development
+
+## React / CSS / HTML Convention
+
+**Folder Structure**
+
+```javascript
+public/components // Shared/Basic Components
+
+public/pages // Pages
+
+public/pages/Home // Home page component folder
+ -> index.ts // exporter
+ -> Home.page.scss // Page specific styles
+ -> Home.page.spec.tsx // Page Component unit tests
+ -> Home.page.tsx // Page Component
+ -> ./components // Inner components of home page
+```
+
+**CSS Naming**
+
+* `p-<page_name>` is the HTML ID of each page component. This is truly unique and should be used to provide page isolated style. E.g.: `p-home`, `p-user-settings`;
+
+* `c-<component_name>` is the main class for each component. Inner components should follow its parent component name as such `c-<component_name>-<inner_component_name>`. E.g: `c-toggle` and `c-toggle-label`;
+
+* `m-<state>` is used to alter the style of a component and it's always related to its component. So `m-disable` of `c-toggle` is different than `m-disable` of `c-button`, even though they have same name.
+
+* `l-<name>` is used to general layout styling. It's does not need to be related to any component or page.
+
+* `is-<state>`, `has-<state>` or simply `<state>` are global style modifiers that have a broader impact.
+
+* `js-<name>` is used to JavaScript hooks, should be avoided as much as possible;
+```
\ No newline at end of file
diff --git a/app/actions/tenant.go b/app/actions/tenant.go
index fea860ef2..0e245fe06 100644
--- a/app/actions/tenant.go
+++ b/app/actions/tenant.go
@@ -136,6 +136,27 @@ func (input *UpdateTenantSettings) Validate(user *models.User, services *app.Ser
return result
}
+//UpdateTenantAdvancedSettings is the input model used to update tenant advanced settings
+type UpdateTenantAdvancedSettings struct {
+ Model *models.UpdateTenantAdvancedSettings
+}
+
+// Initialize the model
+func (input *UpdateTenantAdvancedSettings) Initialize() interface{} {
+ input.Model = new(models.UpdateTenantAdvancedSettings)
+ return input.Model
+}
+
+// IsAuthorized returns true if current user is authorized to perform this action
+func (input *UpdateTenantAdvancedSettings) IsAuthorized(user *models.User, services *app.Services) bool {
+ return user != nil && user.Role == models.RoleAdministrator
+}
+
+// Validate is current model is valid
+func (input *UpdateTenantAdvancedSettings) Validate(user *models.User, services *app.Services) *validate.Result {
+ return validate.Success()
+}
+
//UpdateTenantPrivacy is the input model used to update tenant privacy settings
type UpdateTenantPrivacy struct {
Model *models.UpdateTenantPrivacy
diff --git a/app/cmd/routes.go b/app/cmd/routes.go
index c9545f7ee..025bba675 100644
--- a/app/cmd/routes.go
+++ b/app/cmd/routes.go
@@ -1,6 +1,7 @@
package cmd
import (
+ "net/http"
"time"
"github.com/getfider/fider/app/handlers"
@@ -48,10 +49,14 @@ func routes(r *web.Engine) *web.Engine {
avatar.Use(middlewares.ClientCache(72 * time.Hour))
avatar.Get("/avatars/:size/:id/:name", handlers.Avatar())
avatar.Get("/logo/:size/:id", handlers.Logo())
+ avatar.Get("/custom/:md5.css", func(c web.Context) error {
+ return c.Blob(http.StatusOK, "text/css", []byte(c.Tenant().CustomCSS))
+ })
}
open := r.Group()
{
+ open.Get("/-/ui", handlers.Page("UI Toolkit", "A preview of Fider UI elements"))
open.Get("/signup/verify", handlers.VerifySignUpKey())
open.Use(middlewares.OnlyActiveTenants())
open.Get("/signin", handlers.SignInPage())
@@ -106,6 +111,7 @@ func routes(r *web.Engine) *web.Engine {
private.Use(middlewares.IsAuthorized(models.RoleCollaborator, models.RoleAdministrator))
private.Get("/admin", handlers.GeneralSettingsPage())
+ private.Get("/admin/advanced", handlers.AdvancedSettingsPage())
private.Get("/admin/privacy", handlers.Page("Privacy · Site Settings", ""))
private.Get("/admin/invitations", handlers.Page("Invitations · Site Settings", ""))
private.Get("/admin/members", handlers.ManageMembers())
@@ -119,6 +125,7 @@ func routes(r *web.Engine) *web.Engine {
private.Get("/admin/export/ideas.csv", handlers.ExportIdeasToCSV())
private.Delete("/api/ideas/:number", handlers.DeleteIdea())
private.Post("/api/admin/settings/general", handlers.UpdateSettings())
+ private.Post("/api/admin/settings/advanced", handlers.UpdateAdvancedSettings())
private.Post("/api/admin/settings/privacy", handlers.UpdatePrivacy())
private.Delete("/api/admin/tags/:slug", handlers.DeleteTag())
private.Post("/api/admin/tags/:slug", handlers.CreateEditTag())
diff --git a/app/handlers/admin.go b/app/handlers/admin.go
index ae3b9f76e..c40d5c91f 100644
--- a/app/handlers/admin.go
+++ b/app/handlers/admin.go
@@ -23,6 +23,18 @@ func GeneralSettingsPage() web.HandlerFunc {
}
}
+// AdvancedSettingsPage is the advanced settings page
+func AdvancedSettingsPage() web.HandlerFunc {
+ return func(c web.Context) error {
+ return c.Page(web.Props{
+ Title: "Advanced · Site Settings",
+ Data: web.Map{
+ "customCSS": c.Tenant().CustomCSS,
+ },
+ })
+ }
+}
+
// UpdateSettings update current tenant' settings
func UpdateSettings() web.HandlerFunc {
return func(c web.Context) error {
@@ -40,6 +52,23 @@ func UpdateSettings() web.HandlerFunc {
}
}
+// UpdateAdvancedSettings update current tenant' advanced settings
+func UpdateAdvancedSettings() web.HandlerFunc {
+ return func(c web.Context) error {
+ input := new(actions.UpdateTenantAdvancedSettings)
+ if result := c.BindTo(input); !result.Ok {
+ return c.HandleValidation(result)
+ }
+
+ err := c.Services().Tenants.UpdateAdvancedSettings(input.Model)
+ if err != nil {
+ return c.Failure(err)
+ }
+
+ return c.Ok(web.Map{})
+ }
+}
+
// UpdatePrivacy update current tenant's privacy settings
func UpdatePrivacy() web.HandlerFunc {
return func(c web.Context) error {
diff --git a/app/handlers/images.go b/app/handlers/images.go
index 40f43e39f..4621ebc33 100644
--- a/app/handlers/images.go
+++ b/app/handlers/images.go
@@ -2,7 +2,6 @@ package handlers
import (
"bytes"
- "crypto/md5"
"fmt"
"image/png"
"io/ioutil"
@@ -10,6 +9,7 @@ import (
"strings"
"github.com/getfider/fider/app/pkg/img"
+ "github.com/getfider/fider/app/pkg/md5"
"github.com/getfider/fider/app/pkg/web"
"github.com/goenning/letteravatar"
@@ -26,8 +26,7 @@ func Avatar() web.HandlerFunc {
user, err := c.Services().Users.GetByID(id)
if err == nil && user.Tenant.ID == c.Tenant().ID {
if user.Email != "" {
- hash := md5.Sum([]byte(user.Email))
- url := fmt.Sprintf("https://www.gravatar.com/avatar/%x?s=%d&d=404", hash, size)
+ url := fmt.Sprintf("https://www.gravatar.com/avatar/%s?s=%d&d=404", md5.Hash(user.Email), size)
c.Logger().Debugf("Requesting gravatar: %s", url)
resp, err := http.Get(url)
if err == nil {
diff --git a/app/middlewares/setup.go b/app/middlewares/setup.go
index dde71c3a5..215a5380c 100644
--- a/app/middlewares/setup.go
+++ b/app/middlewares/setup.go
@@ -57,7 +57,7 @@ func WorkerSetup(logger log.Logger) worker.MiddlewareFunc {
}
c.Failure(err)
trx.Rollback()
- c.Logger().Debugf("Task '%s' finished in %s (rolled back)", log.Magenta(c.TaskName()), log.Magenta(time.Since(start).String()))
+ c.Logger().Debugf("Task '%s' panicked in %s (rolled back)", log.Magenta(c.TaskName()), log.Magenta(time.Since(start).String()))
}
}()
@@ -121,7 +121,7 @@ func WebSetup(logger log.Logger) web.MiddlewareFunc {
}
c.Failure(err)
c.Rollback()
- c.Logger().Debugf("%s finished in %s (rolled back)", path, log.Magenta(time.Since(start).String()))
+ c.Logger().Debugf("%s panicked in %s (rolled back)", path, log.Magenta(time.Since(start).String()))
}
}()
diff --git a/app/models/identity.go b/app/models/identity.go
index b357a7d09..ffc783bd5 100644
--- a/app/models/identity.go
+++ b/app/models/identity.go
@@ -19,6 +19,7 @@ type Tenant struct {
Status int `json:"-"`
IsPrivate bool `json:"isPrivate"`
LogoID int `json:"logoId"`
+ CustomCSS string `json:"-"`
}
var (
@@ -154,6 +155,11 @@ type UpdateTenantSettings struct {
CNAME string `json:"cname" format:"lower"`
}
+//UpdateTenantAdvancedSettings is the input model used to update tenant advanced settings
+type UpdateTenantAdvancedSettings struct {
+ CustomCSS string `json:"customCSS"`
+}
+
//UpdateTenantSettingsLogo is the input model used to update logo
type UpdateTenantSettingsLogo struct {
Upload *UpdateTenantSettingsLogoUpload `json:"upload"`
diff --git a/app/pkg/dbx/setup.sql b/app/pkg/dbx/setup.sql
index ded7fc3d3..de6e4713b 100644
--- a/app/pkg/dbx/setup.sql
+++ b/app/pkg/dbx/setup.sql
@@ -1,6 +1,6 @@
TRUNCATE TABLE tenants RESTART IDENTITY CASCADE;
-INSERT INTO tenants (name, subdomain, created_on, cname, invitation, welcome_message, status, is_private) VALUES ('Demonstration', 'demo', now(), '', '', '', 1, false);
+INSERT INTO tenants (name, subdomain, created_on, cname, invitation, welcome_message, status, is_private, custom_css) VALUES ('Demonstration', 'demo', now(), '', '', '', 1, false, '');
INSERT INTO users (name, email, tenant_id, created_on, role) VALUES ('Jon Snow', '[email protected]', 1, now(), 3);
INSERT INTO user_providers (user_id, tenant_id, provider, provider_uid, created_on) VALUES (1, 1, 'facebook', 'FB1234', now());
@@ -10,7 +10,7 @@ INSERT INTO user_providers (user_id, tenant_id, provider, provider_uid, created_
INSERT INTO users (name, email, tenant_id, created_on, role) VALUES ('Sansa Stark', '[email protected]', 1, now(), 1);
-INSERT INTO tenants (name, subdomain, created_on, cname, invitation, welcome_message, status, is_private) VALUES ('Avengers', 'avengers', now(), 'feedback.avengers.com', '', '', 1, false);
+INSERT INTO tenants (name, subdomain, created_on, cname, invitation, welcome_message, status, is_private, custom_css) VALUES ('Avengers', 'avengers', now(), 'feedback.avengers.com', '', '', 1, false, '');
INSERT INTO users (name, email, tenant_id, created_on, role) VALUES ('Tony Stark', '[email protected]', 2, now(), 3);
INSERT INTO user_providers (user_id, tenant_id, provider, provider_uid, created_on) VALUES (4, 2, 'facebook', 'FB2222', now());
diff --git a/app/pkg/md5/md5.go b/app/pkg/md5/md5.go
new file mode 100644
index 000000000..31deadbc4
--- /dev/null
+++ b/app/pkg/md5/md5.go
@@ -0,0 +1,11 @@
+package md5
+
+import (
+ "crypto/md5"
+ "fmt"
+)
+
+//Hash returns the MD5 hash of a given string
+func Hash(input string) string {
+ return fmt.Sprintf("%x", md5.Sum([]byte(input)))
+}
diff --git a/app/pkg/md5/md5_test.go b/app/pkg/md5/md5_test.go
new file mode 100644
index 000000000..c2554d6f1
--- /dev/null
+++ b/app/pkg/md5/md5_test.go
@@ -0,0 +1,16 @@
+package md5_test
+
+import (
+ "testing"
+
+ . "github.com/getfider/fider/app/pkg/assert"
+ "github.com/getfider/fider/app/pkg/md5"
+)
+
+func TestMD5Hash(t *testing.T) {
+ RegisterT(t)
+
+ hash := md5.Hash("Fider")
+
+ Expect(hash).Equals("3734538c8b650e4f354a55a436566bb6")
+}
diff --git a/app/pkg/web/context.go b/app/pkg/web/context.go
index 7f30633d8..5bf1f328c 100644
--- a/app/pkg/web/context.go
+++ b/app/pkg/web/context.go
@@ -272,9 +272,7 @@ func (ctx *Context) Page(props Props) error {
// Render renders a template with data and sends a text/html response with status
func (ctx *Context) Render(code int, template string, props Props) error {
buf := new(bytes.Buffer)
- if err := ctx.engine.renderer.Render(buf, template, props, ctx); err != nil {
- return err
- }
+ ctx.engine.renderer.Render(buf, template, props, ctx)
return ctx.Blob(code, HTMLContentType, buf.Bytes())
}
diff --git a/app/pkg/web/renderer.go b/app/pkg/web/renderer.go
index 7ab73235b..101f1d03e 100644
--- a/app/pkg/web/renderer.go
+++ b/app/pkg/web/renderer.go
@@ -12,9 +12,16 @@ import (
"github.com/getfider/fider/app/pkg/env"
"github.com/getfider/fider/app/pkg/errors"
"github.com/getfider/fider/app/pkg/log"
+ "github.com/getfider/fider/app/pkg/md5"
"github.com/getfider/fider/app/pkg/oauth"
)
+var templateFunctions = template.FuncMap{
+ "md5": func(input string) string {
+ return md5.Hash(input)
+ },
+}
+
//Renderer is the default HTML Render
type Renderer struct {
templates map[string]*template.Template
@@ -49,7 +56,7 @@ func NewRenderer(settings *models.SystemSettings, logger log.Logger) *Renderer {
func (r *Renderer) add(name string) *template.Template {
base := env.Path("/views/base.html")
file := env.Path("/views", name)
- tpl, err := template.ParseFiles(base, file)
+ tpl, err := template.New("base.html").Funcs(templateFunctions).ParseFiles(base, file)
if err != nil {
panic(errors.Wrap(err, "failed to parse template %s", file))
}
@@ -73,7 +80,7 @@ func (r *Renderer) getBundle(folder string) string {
}
//Render a template based on parameters
-func (r *Renderer) Render(w io.Writer, name string, props Props, ctx *Context) error {
+func (r *Renderer) Render(w io.Writer, name string, props Props, ctx *Context) {
tmpl, ok := r.templates[name]
if !ok {
panic(fmt.Errorf("The template '%s' does not exist", name))
@@ -145,7 +152,6 @@ func (r *Renderer) Render(w io.Writer, name string, props Props, ctx *Context) e
err := tmpl.Execute(w, m)
if err != nil {
- return errors.Wrap(err, "failed to execute template %s", name)
+ panic(errors.Wrap(err, "failed to execute template %s", name))
}
- return nil
}
diff --git a/app/storage/inmemory/tenant.go b/app/storage/inmemory/tenant.go
index 188aa9d6e..62db1669c 100644
--- a/app/storage/inmemory/tenant.go
+++ b/app/storage/inmemory/tenant.go
@@ -107,6 +107,17 @@ func (s *TenantStorage) UpdateSettings(settings *models.UpdateTenantSettings) er
return nil
}
+// UpdateAdvancedSettings of current tenant
+func (s *TenantStorage) UpdateAdvancedSettings(settings *models.UpdateTenantAdvancedSettings) error {
+ for _, tenant := range s.tenants {
+ if tenant.ID == s.current.ID {
+ tenant.CustomCSS = settings.CustomCSS
+ return nil
+ }
+ }
+ return nil
+}
+
// UpdatePrivacy settings of current tenant
func (s *TenantStorage) UpdatePrivacy(settings *models.UpdateTenantPrivacy) error {
for _, tenant := range s.tenants {
diff --git a/app/storage/postgres/tenant.go b/app/storage/postgres/tenant.go
index a1dcfa3a9..5c97ea31a 100644
--- a/app/storage/postgres/tenant.go
+++ b/app/storage/postgres/tenant.go
@@ -23,6 +23,7 @@ type dbTenant struct {
Status int `db:"status"`
IsPrivate bool `db:"is_private"`
LogoID dbx.NullInt `db:"logo_id"`
+ CustomCSS string `db:"custom_css"`
}
func (t *dbTenant) toModel() *models.Tenant {
@@ -39,6 +40,7 @@ func (t *dbTenant) toModel() *models.Tenant {
WelcomeMessage: t.WelcomeMessage,
Status: t.Status,
IsPrivate: t.IsPrivate,
+ CustomCSS: t.CustomCSS,
}
if t.LogoID.Valid {
@@ -108,8 +110,8 @@ func (s *TenantStorage) SetCurrentUser(user *models.User) {
func (s *TenantStorage) Add(name string, subdomain string, status int) (*models.Tenant, error) {
var id int
err := s.trx.Get(&id,
- `INSERT INTO tenants (name, subdomain, created_on, cname, invitation, welcome_message, status, is_private)
- VALUES ($1, $2, $3, '', '', '', $4, false)
+ `INSERT INTO tenants (name, subdomain, created_on, cname, invitation, welcome_message, status, is_private, custom_css)
+ VALUES ($1, $2, $3, '', '', '', $4, false, '')
RETURNING id`, name, subdomain, time.Now(), status)
if err != nil {
return nil, err
@@ -122,7 +124,7 @@ func (s *TenantStorage) Add(name string, subdomain string, status int) (*models.
func (s *TenantStorage) First() (*models.Tenant, error) {
tenant := dbTenant{}
- err := s.trx.Get(&tenant, "SELECT id, name, subdomain, cname, invitation, welcome_message, status, is_private, logo_id FROM tenants ORDER BY id LIMIT 1")
+ err := s.trx.Get(&tenant, "SELECT id, name, subdomain, cname, invitation, welcome_message, status, is_private, logo_id, custom_css FROM tenants ORDER BY id LIMIT 1")
if err != nil {
return nil, errors.Wrap(err, "failed to get first tenant")
}
@@ -134,7 +136,7 @@ func (s *TenantStorage) First() (*models.Tenant, error) {
func (s *TenantStorage) GetByDomain(domain string) (*models.Tenant, error) {
tenant := dbTenant{}
- err := s.trx.Get(&tenant, "SELECT id, name, subdomain, cname, invitation, welcome_message, status, is_private, logo_id FROM tenants WHERE subdomain = $1 OR cname = $2 ORDER BY cname DESC", extractSubdomain(domain), domain)
+ err := s.trx.Get(&tenant, "SELECT id, name, subdomain, cname, invitation, welcome_message, status, is_private, logo_id, custom_css FROM tenants WHERE subdomain = $1 OR cname = $2 ORDER BY cname DESC", extractSubdomain(domain), domain)
if err != nil {
return nil, errors.Wrap(err, "failed to get tenant with domain '%s'", domain)
}
@@ -188,6 +190,17 @@ func (s *TenantStorage) UpdateSettings(settings *models.UpdateTenantSettings) er
return nil
}
+// UpdateAdvancedSettings of current tenant
+func (s *TenantStorage) UpdateAdvancedSettings(settings *models.UpdateTenantAdvancedSettings) error {
+ query := "UPDATE tenants SET custom_css = $1 WHERE id = $2"
+ _, err := s.trx.Execute(query, settings.CustomCSS, s.current.ID)
+ if err != nil {
+ return errors.Wrap(err, "failed update tenant advanced settings")
+ }
+ s.current.CustomCSS = settings.CustomCSS
+ return nil
+}
+
// UpdatePrivacy settings of current tenant
func (s *TenantStorage) UpdatePrivacy(settings *models.UpdateTenantPrivacy) error {
query := "UPDATE tenants SET is_private = $1 WHERE id = $2"
diff --git a/app/storage/postgres/tenant_test.go b/app/storage/postgres/tenant_test.go
index c809e7d55..ca967b2b1 100644
--- a/app/storage/postgres/tenant_test.go
+++ b/app/storage/postgres/tenant_test.go
@@ -244,6 +244,24 @@ func TestTenantStorage_UpdateSettings_ReplaceLogo(t *testing.T) {
Expect(upload).IsNil()
}
+func TestTenantStorage_AdvancedSettings(t *testing.T) {
+ SetupDatabaseTest(t)
+ defer TeardownDatabaseTest()
+
+ tenant, _ := tenants.GetByDomain("demo")
+ tenants.SetCurrentTenant(tenant)
+
+ settings := &models.UpdateTenantAdvancedSettings{
+ CustomCSS: ".primary { color: red; }",
+ }
+ err := tenants.UpdateAdvancedSettings(settings)
+ Expect(err).IsNil()
+
+ tenant, err = tenants.GetByDomain("demo")
+ Expect(err).IsNil()
+ Expect(tenant.CustomCSS).Equals(".primary { color: red; }")
+}
+
func TestTenantStorage_SaveFindSet_VerificationKey(t *testing.T) {
SetupDatabaseTest(t)
defer TeardownDatabaseTest()
diff --git a/app/storage/postgres/user_test.go b/app/storage/postgres/user_test.go
index 1ca19604d..99d33fb34 100644
--- a/app/storage/postgres/user_test.go
+++ b/app/storage/postgres/user_test.go
@@ -140,8 +140,8 @@ func TestUserStorage_Register_MultipleProviders(t *testing.T) {
var tenantID int
trx.Get(&tenantID, `
- INSERT INTO tenants (name, subdomain, created_on, status, is_private)
- VALUES ('My Domain Inc.','mydomain', now(), 1, false)
+ INSERT INTO tenants (name, subdomain, created_on, status, is_private, custom_css)
+ VALUES ('My Domain Inc.','mydomain', now(), 1, false, '')
RETURNING id
`)
users.SetCurrentTenant(&models.Tenant{
diff --git a/app/storage/storage.go b/app/storage/storage.go
index dad23bd59..dc1ff6996 100644
--- a/app/storage/storage.go
+++ b/app/storage/storage.go
@@ -63,6 +63,7 @@ type Tenant interface {
Activate(id int) error
GetByDomain(domain string) (*models.Tenant, error)
UpdateSettings(settings *models.UpdateTenantSettings) error
+ UpdateAdvancedSettings(settings *models.UpdateTenantAdvancedSettings) error
UpdatePrivacy(settings *models.UpdateTenantPrivacy) error
IsSubdomainAvailable(subdomain string) (bool, error)
IsCNAMEAvailable(cname string) (bool, error)
diff --git a/migrations/201805162034_add_custom_css.up.sql b/migrations/201805162034_add_custom_css.up.sql
new file mode 100644
index 000000000..7bcba6983
--- /dev/null
+++ b/migrations/201805162034_add_custom_css.up.sql
@@ -0,0 +1,5 @@
+ALTER TABLE tenants ADD custom_css TEXT NULL;
+
+UPDATE tenants SET custom_css = '';
+
+ALTER TABLE tenants ALTER COLUMN custom_css SET NOT NULL;
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 7b66c4629..8a6115000 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -61,6 +61,16 @@
}
}
},
+ "@mrmlnc/readdir-enhanced": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz",
+ "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==",
+ "dev": true,
+ "requires": {
+ "call-me-maybe": "^1.0.1",
+ "glob-to-regexp": "^0.3.0"
+ }
+ },
"@sindresorhus/is": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
@@ -102,9 +112,9 @@
"dev": true
},
"@types/node": {
- "version": "9.6.7",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.7.tgz",
- "integrity": "sha512-MuUfEDBrQ/hb7KOqMiDeItAuRxlilQUgNRthTSCU4HgilH8UBh7wiHxWrv/lcyHyFZcREaODVVRNrAunphVwlg==",
+ "version": "10.0.8",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.0.8.tgz",
+ "integrity": "sha512-MFFKFv2X4iZy/NFl1m1E8uwE1CR96SGwJjgHma09PLtqOWoj3nqeJHMG+P/EuJGVLvC2I6MdQRQsr4TcRduIow==",
"dev": true
},
"@types/react": {
@@ -147,6 +157,219 @@
"integrity": "sha512-vOVmaruQG5EatOU/jM6yU2uCp3Lz6mK1P5Ztu4iJjfM4SVHU9XYktPUQtKlIXuahqXHdEyUarMrBEwg5Cwu+bA==",
"dev": true
},
+ "@webassemblyjs/ast": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.4.3.tgz",
+ "integrity": "sha512-S6npYhPcTHDYe9nlsKa9CyWByFi8Vj8HovcAgtmMAQZUOczOZbQ8CnwMYKYC5HEZzxEE+oY0jfQk4cVlI3J59Q==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/helper-wasm-bytecode": "1.4.3",
+ "@webassemblyjs/wast-parser": "1.4.3",
+ "debug": "^3.1.0",
+ "webassemblyjs": "1.4.3"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ }
+ }
+ },
+ "@webassemblyjs/floating-point-hex-parser": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.4.3.tgz",
+ "integrity": "sha512-3zTkSFswwZOPNHnzkP9ONq4bjJSeKVMcuahGXubrlLmZP8fmTIJ58dW7h/zOVWiFSuG2em3/HH3BlCN7wyu9Rw==",
+ "dev": true
+ },
+ "@webassemblyjs/helper-buffer": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.4.3.tgz",
+ "integrity": "sha512-e8+KZHh+RV8MUvoSRtuT1sFXskFnWG9vbDy47Oa166xX+l0dD5sERJ21g5/tcH8Yo95e9IN3u7Jc3NbhnUcSkw==",
+ "dev": true,
+ "requires": {
+ "debug": "^3.1.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ }
+ }
+ },
+ "@webassemblyjs/helper-code-frame": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.4.3.tgz",
+ "integrity": "sha512-9FgHEtNsZQYaKrGCtsjswBil48Qp1agrzRcPzCbQloCoaTbOXLJ9IRmqT+uEZbenpULLRNFugz3I4uw18hJM8w==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/wast-printer": "1.4.3"
+ }
+ },
+ "@webassemblyjs/helper-fsm": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.4.3.tgz",
+ "integrity": "sha512-JINY76U+702IRf7ePukOt037RwmtH59JHvcdWbTTyHi18ixmQ+uOuNhcdCcQHTquDAH35/QgFlp3Y9KqtyJsCQ==",
+ "dev": true
+ },
+ "@webassemblyjs/helper-wasm-bytecode": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.4.3.tgz",
+ "integrity": "sha512-I7bS+HaO0K07Io89qhJv+z1QipTpuramGwUSDkwEaficbSvCcL92CUZEtgykfNtk5wb0CoLQwWlmXTwGbNZUeQ==",
+ "dev": true
+ },
+ "@webassemblyjs/helper-wasm-section": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.4.3.tgz",
+ "integrity": "sha512-p0yeeO/h2r30PyjnJX9xXSR6EDcvJd/jC6xa/Pxg4lpfcNi7JUswOpqDToZQ55HMMVhXDih/yqkaywHWGLxqyQ==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.4.3",
+ "@webassemblyjs/helper-buffer": "1.4.3",
+ "@webassemblyjs/helper-wasm-bytecode": "1.4.3",
+ "@webassemblyjs/wasm-gen": "1.4.3",
+ "debug": "^3.1.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ }
+ }
+ },
+ "@webassemblyjs/leb128": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.4.3.tgz",
+ "integrity": "sha512-4u0LJLSPzuRDWHwdqsrThYn+WqMFVqbI2ltNrHvZZkzFPO8XOZ0HFQ5eVc4jY/TNHgXcnwrHjONhPGYuuf//KQ==",
+ "dev": true,
+ "requires": {
+ "leb": "^0.3.0"
+ }
+ },
+ "@webassemblyjs/validation": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/validation/-/validation-1.4.3.tgz",
+ "integrity": "sha512-R+rRMKfhd9mq0rj2mhU9A9NKI2l/Rw65vIYzz4lui7eTKPcCu1l7iZNi4b9Gen8D42Sqh/KGiaQNk/x5Tn/iBQ==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.4.3"
+ }
+ },
+ "@webassemblyjs/wasm-edit": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.4.3.tgz",
+ "integrity": "sha512-qzuwUn771PV6/LilqkXcS0ozJYAeY/OKbXIWU3a8gexuqb6De2p4ya/baBeH5JQ2WJdfhWhSvSbu86Vienttpw==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.4.3",
+ "@webassemblyjs/helper-buffer": "1.4.3",
+ "@webassemblyjs/helper-wasm-bytecode": "1.4.3",
+ "@webassemblyjs/helper-wasm-section": "1.4.3",
+ "@webassemblyjs/wasm-gen": "1.4.3",
+ "@webassemblyjs/wasm-opt": "1.4.3",
+ "@webassemblyjs/wasm-parser": "1.4.3",
+ "@webassemblyjs/wast-printer": "1.4.3",
+ "debug": "^3.1.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ }
+ }
+ },
+ "@webassemblyjs/wasm-gen": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.4.3.tgz",
+ "integrity": "sha512-eR394T8dHZfpLJ7U/Z5pFSvxl1L63JdREebpv9gYc55zLhzzdJPAuxjBYT4XqevUdW67qU2s0nNA3kBuNJHbaQ==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.4.3",
+ "@webassemblyjs/helper-wasm-bytecode": "1.4.3",
+ "@webassemblyjs/leb128": "1.4.3"
+ }
+ },
+ "@webassemblyjs/wasm-opt": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.4.3.tgz",
+ "integrity": "sha512-7Gp+nschuKiDuAL1xmp4Xz0rgEbxioFXw4nCFYEmy+ytynhBnTeGc9W9cB1XRu1w8pqRU2lbj2VBBA4cL5Z2Kw==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.4.3",
+ "@webassemblyjs/helper-buffer": "1.4.3",
+ "@webassemblyjs/wasm-gen": "1.4.3",
+ "@webassemblyjs/wasm-parser": "1.4.3",
+ "debug": "^3.1.0"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+ "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ }
+ }
+ },
+ "@webassemblyjs/wasm-parser": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.4.3.tgz",
+ "integrity": "sha512-KXBjtlwA3BVukR/yWHC9GF+SCzBcgj0a7lm92kTOaa4cbjaTaa47bCjXw6cX4SGQpkncB9PU2hHGYVyyI7wFRg==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.4.3",
+ "@webassemblyjs/helper-wasm-bytecode": "1.4.3",
+ "@webassemblyjs/leb128": "1.4.3",
+ "@webassemblyjs/wasm-parser": "1.4.3",
+ "webassemblyjs": "1.4.3"
+ }
+ },
+ "@webassemblyjs/wast-parser": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.4.3.tgz",
+ "integrity": "sha512-QhCsQzqV0CpsEkRYyTzQDilCNUZ+5j92f+g35bHHNqS22FppNTywNFfHPq8ZWZfYCgbectc+PoghD+xfzVFh1Q==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.4.3",
+ "@webassemblyjs/floating-point-hex-parser": "1.4.3",
+ "@webassemblyjs/helper-code-frame": "1.4.3",
+ "@webassemblyjs/helper-fsm": "1.4.3",
+ "long": "^3.2.0",
+ "webassemblyjs": "1.4.3"
+ }
+ },
+ "@webassemblyjs/wast-printer": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.4.3.tgz",
+ "integrity": "sha512-EgXk4anf8jKmuZJsqD8qy5bz2frEQhBvZruv+bqwNoLWUItjNSFygk8ywL3JTEz9KtxTlAmqTXNrdD1d9gNDtg==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.4.3",
+ "@webassemblyjs/wast-parser": "1.4.3",
+ "long": "^3.2.0"
+ }
+ },
"abab": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz",
@@ -1394,9 +1617,9 @@
}
},
"babylon": {
- "version": "7.0.0-beta.46",
- "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.46.tgz",
- "integrity": "sha512-WFJlg2WatdkXRFMpk7BN/Uzzkjkcjk+WaqnrSCpay+RYl4ypW9ZetZyT9kNt22IH/BQNst3M6PaaBn9IXsUNrg==",
+ "version": "6.18.0",
+ "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz",
+ "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
"dev": true
},
"balanced-match": {
@@ -1822,6 +2045,12 @@
}
}
},
+ "call-me-maybe": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz",
+ "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=",
+ "dev": true
+ },
"callsites": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz",
@@ -1899,23 +2128,106 @@
"dev": true
},
"chokidar": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz",
- "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==",
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
+ "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=",
"dev": true,
"requires": {
- "anymatch": "^2.0.0",
+ "anymatch": "^1.3.0",
"async-each": "^1.0.0",
- "braces": "^2.3.0",
- "fsevents": "^1.1.2",
- "glob-parent": "^3.1.0",
+ "fsevents": "^1.0.0",
+ "glob-parent": "^2.0.0",
"inherits": "^2.0.1",
"is-binary-path": "^1.0.0",
- "is-glob": "^4.0.0",
- "normalize-path": "^2.1.1",
+ "is-glob": "^2.0.0",
"path-is-absolute": "^1.0.0",
- "readdirp": "^2.0.0",
- "upath": "^1.0.0"
+ "readdirp": "^2.0.0"
+ },
+ "dependencies": {
+ "anymatch": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz",
+ "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==",
+ "dev": true,
+ "requires": {
+ "micromatch": "^2.1.5",
+ "normalize-path": "^2.0.0"
+ }
+ },
+ "arr-diff": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
+ "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
+ "dev": true,
+ "requires": {
+ "arr-flatten": "^1.0.1"
+ }
+ },
+ "array-unique": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
+ "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
+ "dev": true
+ },
+ "braces": {
+ "version": "1.8.5",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
+ "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
+ "dev": true,
+ "requires": {
+ "expand-range": "^1.8.1",
+ "preserve": "^0.2.0",
+ "repeat-element": "^1.1.2"
+ }
+ },
+ "expand-brackets": {
+ "version": "0.1.5",
+ "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
+ "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
+ "dev": true,
+ "requires": {
+ "is-posix-bracket": "^0.1.0"
+ }
+ },
+ "extglob": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
+ "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^1.0.0"
+ }
+ },
+ "kind-of": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+ "dev": true,
+ "requires": {
+ "is-buffer": "^1.1.5"
+ }
+ },
+ "micromatch": {
+ "version": "2.3.11",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
+ "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
+ "dev": true,
+ "requires": {
+ "arr-diff": "^2.0.0",
+ "array-unique": "^0.2.1",
+ "braces": "^1.8.2",
+ "expand-brackets": "^0.1.4",
+ "extglob": "^0.3.1",
+ "filename-regex": "^2.0.0",
+ "is-extglob": "^1.0.0",
+ "is-glob": "^2.0.1",
+ "kind-of": "^3.0.2",
+ "normalize-path": "^2.0.1",
+ "object.omit": "^2.0.0",
+ "parse-glob": "^3.0.4",
+ "regex-cache": "^0.4.2"
+ }
+ }
}
},
"chownr": {
@@ -2295,157 +2607,30 @@
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true
- },
- "cpx": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/cpx/-/cpx-1.5.0.tgz",
- "integrity": "sha1-GFvgGFEdhycN7czCkxceN2VauI8=",
- "dev": true,
- "requires": {
- "babel-runtime": "^6.9.2",
- "chokidar": "^1.6.0",
- "duplexer": "^0.1.1",
- "glob": "^7.0.5",
- "glob2base": "^0.0.12",
- "minimatch": "^3.0.2",
- "mkdirp": "^0.5.1",
- "resolve": "^1.1.7",
- "safe-buffer": "^5.0.1",
- "shell-quote": "^1.6.1",
- "subarg": "^1.0.0"
- },
- "dependencies": {
- "anymatch": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz",
- "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==",
- "dev": true,
- "requires": {
- "micromatch": "^2.1.5",
- "normalize-path": "^2.0.0"
- }
- },
- "arr-diff": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
- "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
- "dev": true,
- "requires": {
- "arr-flatten": "^1.0.1"
- }
- },
- "array-unique": {
- "version": "0.2.1",
- "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
- "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
- "dev": true
- },
- "braces": {
- "version": "1.8.5",
- "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
- "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=",
- "dev": true,
- "requires": {
- "expand-range": "^1.8.1",
- "preserve": "^0.2.0",
- "repeat-element": "^1.1.2"
- }
- },
- "chokidar": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
- "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=",
- "dev": true,
- "requires": {
- "anymatch": "^1.3.0",
- "async-each": "^1.0.0",
- "fsevents": "^1.0.0",
- "glob-parent": "^2.0.0",
- "inherits": "^2.0.1",
- "is-binary-path": "^1.0.0",
- "is-glob": "^2.0.0",
- "path-is-absolute": "^1.0.0",
- "readdirp": "^2.0.0"
- }
- },
- "expand-brackets": {
- "version": "0.1.5",
- "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz",
- "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=",
- "dev": true,
- "requires": {
- "is-posix-bracket": "^0.1.0"
- }
- },
- "extglob": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz",
- "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=",
- "dev": true,
- "requires": {
- "is-extglob": "^1.0.0"
- }
- },
- "glob-parent": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
- "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
- "dev": true,
- "requires": {
- "is-glob": "^2.0.0"
- }
- },
- "is-extglob": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
- "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
- "dev": true
- },
- "is-glob": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
- "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
- "dev": true,
- "requires": {
- "is-extglob": "^1.0.0"
- }
- },
- "kind-of": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
- "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
- "dev": true,
- "requires": {
- "is-buffer": "^1.1.5"
- }
- },
- "micromatch": {
- "version": "2.3.11",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz",
- "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=",
- "dev": true,
- "requires": {
- "arr-diff": "^2.0.0",
- "array-unique": "^0.2.1",
- "braces": "^1.8.2",
- "expand-brackets": "^0.1.4",
- "extglob": "^0.3.1",
- "filename-regex": "^2.0.0",
- "is-extglob": "^1.0.0",
- "is-glob": "^2.0.1",
- "kind-of": "^3.0.2",
- "normalize-path": "^2.0.1",
- "object.omit": "^2.0.0",
- "parse-glob": "^3.0.4",
- "regex-cache": "^0.4.2"
- }
- }
+ },
+ "cpx": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/cpx/-/cpx-1.5.0.tgz",
+ "integrity": "sha1-GFvgGFEdhycN7czCkxceN2VauI8=",
+ "dev": true,
+ "requires": {
+ "babel-runtime": "^6.9.2",
+ "chokidar": "^1.6.0",
+ "duplexer": "^0.1.1",
+ "glob": "^7.0.5",
+ "glob2base": "^0.0.12",
+ "minimatch": "^3.0.2",
+ "mkdirp": "^0.5.1",
+ "resolve": "^1.1.7",
+ "safe-buffer": "^5.0.1",
+ "shell-quote": "^1.6.1",
+ "subarg": "^1.0.0"
}
},
"create-ecdh": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.1.tgz",
- "integrity": "sha512-iZvCCg8XqHQZ1ioNBTzXS/cQSkqkqcPs8xSX4upNB+DAk9Ht3uzQf2J32uAHNCne8LDmKr29AgZrEs4oIrwLuQ==",
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
+ "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==",
"dev": true,
"requires": {
"bn.js": "^4.1.0",
@@ -2734,9 +2919,9 @@
}
},
"deep-extend": {
- "version": "0.4.2",
- "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz",
- "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=",
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz",
+ "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==",
"dev": true
},
"deep-is": {
@@ -2885,6 +3070,27 @@
"randombytes": "^2.0.0"
}
},
+ "dir-glob": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz",
+ "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==",
+ "dev": true,
+ "requires": {
+ "arrify": "^1.0.1",
+ "path-type": "^3.0.0"
+ },
+ "dependencies": {
+ "path-type": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
+ "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
+ "dev": true,
+ "requires": {
+ "pify": "^3.0.0"
+ }
+ }
+ }
+ },
"dom-helpers": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.3.1.tgz",
@@ -2924,9 +3130,9 @@
"dev": true
},
"duplexify": {
- "version": "3.5.4",
- "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz",
- "integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==",
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz",
+ "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==",
"dev": true,
"requires": {
"end-of-stream": "^1.0.0",
@@ -2952,9 +3158,9 @@
"dev": true
},
"ejs": {
- "version": "2.5.9",
- "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.5.9.tgz",
- "integrity": "sha512-GJCAeDBKfREgkBtgrYSf9hQy9kTb3helv0zGdzqhM7iAkW8FA/ZF97VQDbwFiwIT8MQLLOe5VlPZOEvZAqtUAQ==",
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.6.1.tgz",
+ "integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==",
"dev": true
},
"electron-to-chromium": {
@@ -3508,6 +3714,57 @@
"integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==",
"dev": true
},
+ "fast-glob": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.1.tgz",
+ "integrity": "sha512-wSyW1TBK3ia5V+te0rGPXudeMHoUQW6O5Y9oATiaGhpENmEifPDlOdhpsnlj5HoG6ttIvGiY1DdCmI9X2xGMhg==",
+ "dev": true,
+ "requires": {
+ "@mrmlnc/readdir-enhanced": "^2.2.1",
+ "glob-parent": "^3.1.0",
+ "is-glob": "^4.0.0",
+ "merge2": "^1.2.1",
+ "micromatch": "^3.1.10"
+ },
+ "dependencies": {
+ "glob-parent": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
+ "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=",
+ "dev": true,
+ "requires": {
+ "is-glob": "^3.1.0",
+ "path-dirname": "^1.0.0"
+ },
+ "dependencies": {
+ "is-glob": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
+ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.0"
+ }
+ }
+ }
+ },
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "dev": true
+ },
+ "is-glob": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
+ "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ }
+ }
+ },
"fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
@@ -3659,9 +3916,9 @@
"dev": true
},
"flow-parser": {
- "version": "0.70.0",
- "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.70.0.tgz",
- "integrity": "sha512-gGdyVUZWswG5jcINrVDHd3RY4nJptBTAx9mR9thGsrGGmAUR7omgJXQSpR+fXrLtxSTAea3HpAZNU/yzRJc2Cg==",
+ "version": "0.72.0",
+ "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.72.0.tgz",
+ "integrity": "sha512-kFaDtviKlD/rHi6NRp42KTbnPgz/nKcWUJQhqDnLDeKA8uGcRVSy0YlQjaf9M3pFo5PgC3SNFnCPpQGLtHjH2w==",
"dev": true
},
"flush-write-stream": {
@@ -3732,9 +3989,9 @@
}
},
"fs-extra": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
- "integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.0.tgz",
+ "integrity": "sha512-lk2cUCo8QzbiEWEbt7Cw3m27WMiRG321xsssbcIpfMhpRjrlC08WBOVQqj1/nQYYNnPtyIhP1oqLO3QwT2tPCw==",
"dev": true,
"requires": {
"graceful-fs": "^4.1.2",
@@ -4525,26 +4782,20 @@
}
},
"glob-parent": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
- "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz",
+ "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=",
"dev": true,
"requires": {
- "is-glob": "^3.1.0",
- "path-dirname": "^1.0.0"
- },
- "dependencies": {
- "is-glob": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
- "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
- "dev": true,
- "requires": {
- "is-extglob": "^2.1.0"
- }
- }
+ "is-glob": "^2.0.0"
}
},
+ "glob-to-regexp": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz",
+ "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=",
+ "dev": true
+ },
"glob2base": {
"version": "0.0.12",
"resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz",
@@ -4617,9 +4868,9 @@
}
},
"got": {
- "version": "8.3.0",
- "resolved": "https://registry.npmjs.org/got/-/got-8.3.0.tgz",
- "integrity": "sha512-kBNy/S2CGwrYgDSec5KTWGKUvupwkkTVAjIsVFF2shXO13xpZdFP4d4kxa//CLX2tN/rV0aYwK8vY6UKWGn2vQ==",
+ "version": "8.3.1",
+ "resolved": "https://registry.npmjs.org/got/-/got-8.3.1.tgz",
+ "integrity": "sha512-tiLX+bnYm5A56T5N/n9Xo89vMaO1mrS9qoDqj3u/anVooqGozvY/HbXzEpDfbNeKsHCBpK40gSbz8wGYSp3i1w==",
"dev": true,
"requires": {
"@sindresorhus/is": "^0.7.0",
@@ -5045,6 +5296,12 @@
"integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=",
"dev": true
},
+ "ignore": {
+ "version": "3.3.8",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz",
+ "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==",
+ "dev": true
+ },
"immediate": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
@@ -5374,9 +5631,9 @@
"dev": true
},
"is-extglob": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
- "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
+ "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
"dev": true
},
"is-finite": {
@@ -5404,12 +5661,12 @@
"dev": true
},
"is-glob": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
- "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
+ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
"dev": true,
"requires": {
- "is-extglob": "^2.1.1"
+ "is-extglob": "^1.0.0"
}
},
"is-my-ip-valid": {
@@ -5622,6 +5879,12 @@
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
},
+ "isbinaryfile": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.2.tgz",
+ "integrity": "sha1-Sj6XTsDLqQBNP8bN5yCeppNopiE=",
+ "dev": true
+ },
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@@ -7245,6 +7508,12 @@
"integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
"dev": true
},
+ "babylon": {
+ "version": "7.0.0-beta.46",
+ "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.46.tgz",
+ "integrity": "sha512-WFJlg2WatdkXRFMpk7BN/Uzzkjkcjk+WaqnrSCpay+RYl4ypW9ZetZyT9kNt22IH/BQNst3M6PaaBn9IXsUNrg==",
+ "dev": true
+ },
"braces": {
"version": "1.8.5",
"resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
@@ -7274,21 +7543,6 @@
"is-extglob": "^1.0.0"
}
},
- "is-extglob": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
- "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
- "dev": true
- },
- "is-glob": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
- "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
- "dev": true,
- "requires": {
- "is-extglob": "^1.0.0"
- }
- },
"kind-of": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
@@ -7523,6 +7777,12 @@
"invert-kv": "^1.0.0"
}
},
+ "leb": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/leb/-/leb-0.3.0.tgz",
+ "integrity": "sha1-Mr7p+tFoMo1q6oUi2DP0GA7tHaM=",
+ "dev": true
+ },
"left-pad": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz",
@@ -7904,6 +8164,12 @@
}
}
},
+ "long": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz",
+ "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=",
+ "dev": true
+ },
"longest": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
@@ -7951,9 +8217,9 @@
"dev": true
},
"make-dir": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz",
- "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==",
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
+ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
"dev": true,
"requires": {
"pify": "^3.0.0"
@@ -8043,16 +8309,17 @@
}
},
"mem-fs-editor": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/mem-fs-editor/-/mem-fs-editor-3.0.2.tgz",
- "integrity": "sha1-3Qpuryu4prN3QAZ6pUnrUwEFr58=",
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/mem-fs-editor/-/mem-fs-editor-4.0.2.tgz",
+ "integrity": "sha512-QHvdXLLNmwJXxKdf7x27aNUren6IoPxwcM8Sfd+S6/ddQQMcYdEtVKsh6ilpqMrU18VQuKZEaH0aCGt3JDbA0g==",
"dev": true,
"requires": {
"commondir": "^1.0.1",
- "deep-extend": "^0.4.0",
- "ejs": "^2.3.1",
+ "deep-extend": "^0.5.1",
+ "ejs": "^2.5.9",
"glob": "^7.0.3",
- "globby": "^6.1.0",
+ "globby": "^8.0.0",
+ "isbinaryfile": "^3.0.2",
"mkdirp": "^0.5.0",
"multimatch": "^2.0.0",
"rimraf": "^2.2.8",
@@ -8072,6 +8339,21 @@
"integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=",
"dev": true
},
+ "globby": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz",
+ "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==",
+ "dev": true,
+ "requires": {
+ "array-union": "^1.0.1",
+ "dir-glob": "^2.0.0",
+ "fast-glob": "^2.0.2",
+ "glob": "^7.1.2",
+ "ignore": "^3.3.5",
+ "pify": "^3.0.0",
+ "slash": "^1.0.0"
+ }
+ },
"replace-ext": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz",
@@ -8145,6 +8427,12 @@
"readable-stream": "^2.0.1"
}
},
+ "merge2": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.2.tgz",
+ "integrity": "sha512-bgM8twH86rWni21thii6WCMQMRMmwqqdW3sGWi9IipnVAszdLXRjwDwAnyrVXo6DuP3AjRMMttZKUB48QWIFGg==",
+ "dev": true
+ },
"micromatch": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
@@ -9995,12 +10283,12 @@
}
},
"pumpify": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.4.0.tgz",
- "integrity": "sha512-2kmNR9ry+Pf45opRVirpNuIFotsxUGLaYqxIwuR77AYrYRMuFCz9eryHBS52L360O+NcR383CL4QYlMKPq4zYA==",
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.0.tgz",
+ "integrity": "sha512-UWi0klDoq8xtVzlMRgENV9F7iCTZExaJQSQL187UXsxpk9NnrKGqTqqUNYAKGOzucSOxs2+jUnRNI+rLviPhJg==",
"dev": true,
"requires": {
- "duplexify": "^3.5.3",
+ "duplexify": "^3.6.0",
"inherits": "^2.0.3",
"pump": "^2.0.0"
}
@@ -10116,9 +10404,9 @@
}
},
"react-toastify": {
- "version": "4.0.0-rc.5",
- "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-4.0.0-rc.5.tgz",
- "integrity": "sha512-0wviE5FjfITvIAze9b2mLFaA8CDNXpTF2ZGbNkOrqZzv86hbMNMBq+kxOEe0dySsSVvxg8u1L9WO/6aPuYYrDQ==",
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-4.0.1.tgz",
+ "integrity": "sha512-CyqSZQw39pIP1SbAddLUCnet8qYBAeLZnGJY8HC/VxBVwGbn4n6DDTapZlvQWkHdAnAQyJuAT4ETctImsSKz0Q==",
"requires": {
"classnames": "^2.2.5",
"prop-types": "^15.6.0",
@@ -10854,9 +11142,9 @@
}
},
"shelljs": {
- "version": "0.8.1",
- "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.1.tgz",
- "integrity": "sha512-YA/iYtZpzFe5HyWVGrb02FjPxc4EMCfpoU/Phg9fQoyMC72u9598OUBrsU8IrtwAKG0tO8IYaqbaLIw+k3IRGA==",
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.2.tgz",
+ "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==",
"dev": true,
"requires": {
"glob": "^7.0.0",
@@ -11193,14 +11481,14 @@
}
},
"stream-http": {
- "version": "2.8.1",
- "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.1.tgz",
- "integrity": "sha512-cQ0jo17BLca2r0GfRdZKYAGLU6JRoIWxqSOakUMuKOT6MOK7AAlE856L33QuDmAy/eeOrhLee3dZKX0Uadu93A==",
+ "version": "2.8.2",
+ "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.2.tgz",
+ "integrity": "sha512-QllfrBhqF1DPcz46WxKTs6Mz1Bpc+8Qm6vbqOpVav5odAXwbyzwnEczoWqtxrsmlO+cJqtPrp/8gWKWjaKLLlA==",
"dev": true,
"requires": {
"builtin-status-codes": "^3.0.0",
"inherits": "^2.0.1",
- "readable-stream": "^2.3.3",
+ "readable-stream": "^2.3.6",
"to-arraybuffer": "^1.0.0",
"xtend": "^4.0.0"
}
@@ -11607,19 +11895,21 @@
}
},
"ts-jest": {
- "version": "22.4.4",
- "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-22.4.4.tgz",
- "integrity": "sha512-v9pO7u4HNMDSBCN9IEvlR6taDAGm2mo7nHEDLWyoFDgYeZ4aHm8JHEPrthd8Pmcl4eCM8J4Ata4ROR/cwFRV2A==",
+ "version": "22.4.6",
+ "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-22.4.6.tgz",
+ "integrity": "sha512-kYQ6g1G1AU+bOO9rv+SSQXg4WTcni6Wx3AM48iHni0nP1vIuhdNRjKTE9Cxx36Ix/IOV7L85iKu07dgXJzH2pQ==",
"dev": true,
"requires": {
- "babel-core": "^6.26.0",
- "babel-plugin-istanbul": "^4.1.4",
- "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
- "babel-preset-jest": "^22.4.0",
+ "babel-core": "^6.26.3",
+ "babel-plugin-istanbul": "^4.1.6",
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
+ "babel-preset-jest": "^22.4.3",
"cpx": "^1.5.0",
- "fs-extra": "4.0.3",
- "jest-config": "^22.4.2",
+ "fs-extra": "6.0.0",
+ "jest-config": "^22.4.3",
+ "lodash": "^4.17.10",
"pkg-dir": "^2.0.0",
+ "source-map-support": "^0.5.5",
"yargs": "^11.0.0"
},
"dependencies": {
@@ -11629,6 +11919,33 @@
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
},
+ "babel-core": {
+ "version": "6.26.3",
+ "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz",
+ "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==",
+ "dev": true,
+ "requires": {
+ "babel-code-frame": "^6.26.0",
+ "babel-generator": "^6.26.0",
+ "babel-helpers": "^6.24.1",
+ "babel-messages": "^6.23.0",
+ "babel-register": "^6.26.0",
+ "babel-runtime": "^6.26.0",
+ "babel-template": "^6.26.0",
+ "babel-traverse": "^6.26.0",
+ "babel-types": "^6.26.0",
+ "babylon": "^6.18.0",
+ "convert-source-map": "^1.5.1",
+ "debug": "^2.6.9",
+ "json5": "^0.5.1",
+ "lodash": "^4.17.4",
+ "minimatch": "^3.0.4",
+ "path-is-absolute": "^1.0.1",
+ "private": "^0.1.8",
+ "slash": "^1.0.0",
+ "source-map": "^0.5.7"
+ }
+ },
"camelcase": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
@@ -11672,6 +11989,24 @@
"mem": "^1.1.0"
}
},
+ "source-map-support": {
+ "version": "0.5.6",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz",
+ "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==",
+ "dev": true,
+ "requires": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
+ }
+ },
"string-width": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
@@ -11729,9 +12064,9 @@
}
},
"ts-loader": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-4.2.0.tgz",
- "integrity": "sha512-EvnwgbEUklPQK82OiZS0NDrG0ZoH91+zef8PFXSOZocSQ5jklQyvAM84Id20UxjVdXVIzMgFu+vlKCQomfq27A==",
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-4.3.0.tgz",
+ "integrity": "sha512-+zduqQJaeouVrGY3y6+nUG7+OE1+Q7slGCHsiQM/aITCEZ0og3GxrJVsnjM5QcWvOcu9C4VR5dP+egIyT+sNNg==",
"dev": true,
"requires": {
"chalk": "^2.3.0",
@@ -11785,9 +12120,9 @@
"dev": true
},
"tslint": {
- "version": "5.9.1",
- "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.9.1.tgz",
- "integrity": "sha1-ElX4ej/1frCw4fDmEKi0dIBGya4=",
+ "version": "5.10.0",
+ "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.10.0.tgz",
+ "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=",
"dev": true,
"requires": {
"babel-code-frame": "^6.22.0",
@@ -11873,9 +12208,9 @@
}
},
"tsutils": {
- "version": "2.26.2",
- "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.26.2.tgz",
- "integrity": "sha512-uzwnhmrSbyinPCiwfzGsOY3IulBTwoky7r83HmZdz9QNCjhSCzavkh47KLWuU0zF2F2WbpmmzoJUIEiYyd+jEQ==",
+ "version": "2.27.0",
+ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.0.tgz",
+ "integrity": "sha512-JcyX25oM9pFcb3zh60OqG1St8p/uSqC5Bgipdo3ieacB/Ao4dPhm7hAtKT9NrEu23CyYrrgJPV3CqYfo+/+T4w==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
@@ -12122,9 +12457,9 @@
"dev": true
},
"upath": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/upath/-/upath-1.0.4.tgz",
- "integrity": "sha512-d4SJySNBXDaQp+DPrziv3xGS6w3d2Xt69FijJr86zMPBy23JEloMCEOUBBzuN7xCtjLCnmB9tI/z7SBCahHBOw==",
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/upath/-/upath-1.0.5.tgz",
+ "integrity": "sha512-qbKn90aDQ0YEwvXoLqj0oiuUYroLX2lVHZ+b+xwjozFasAOC4GneDq5+OaIG5Zj+jFmbz/uO+f7a9qxjktJQww==",
"dev": true
},
"uri-js": {
@@ -12359,6 +12694,77 @@
"chokidar": "^2.0.2",
"graceful-fs": "^4.1.2",
"neo-async": "^2.5.0"
+ },
+ "dependencies": {
+ "chokidar": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz",
+ "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==",
+ "dev": true,
+ "requires": {
+ "anymatch": "^2.0.0",
+ "async-each": "^1.0.0",
+ "braces": "^2.3.0",
+ "fsevents": "^1.1.2",
+ "glob-parent": "^3.1.0",
+ "inherits": "^2.0.1",
+ "is-binary-path": "^1.0.0",
+ "is-glob": "^4.0.0",
+ "normalize-path": "^2.1.1",
+ "path-is-absolute": "^1.0.0",
+ "readdirp": "^2.0.0",
+ "upath": "^1.0.0"
+ }
+ },
+ "glob-parent": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
+ "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=",
+ "dev": true,
+ "requires": {
+ "is-glob": "^3.1.0",
+ "path-dirname": "^1.0.0"
+ },
+ "dependencies": {
+ "is-glob": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
+ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.0"
+ }
+ }
+ }
+ },
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=",
+ "dev": true
+ },
+ "is-glob": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz",
+ "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ }
+ }
+ },
+ "webassemblyjs": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/webassemblyjs/-/webassemblyjs-1.4.3.tgz",
+ "integrity": "sha512-4lOV1Lv6olz0PJkDGQEp82HempAn147e6BXijWDzz9g7/2nSebVP9GVg62Fz5ZAs55mxq13GA0XLyvY8XkyDjg==",
+ "dev": true,
+ "requires": {
+ "@webassemblyjs/ast": "1.4.3",
+ "@webassemblyjs/validation": "1.4.3",
+ "@webassemblyjs/wasm-parser": "1.4.3",
+ "@webassemblyjs/wast-parser": "1.4.3",
+ "long": "^3.2.0"
}
},
"webidl-conversions": {
@@ -12368,11 +12774,14 @@
"dev": true
},
"webpack": {
- "version": "4.6.0",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.6.0.tgz",
- "integrity": "sha512-Fu/k/3fZeGtIhuFkiYpIy1UDHhMiGKjG4FFPVuvG+5Os2lWA1ttWpmi9Qnn6AgfZqj9MvhZW/rmj/ip+nHr06g==",
+ "version": "4.8.3",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.8.3.tgz",
+ "integrity": "sha512-/hfAjBISycdK597lxONjKEFX7dSIU1PsYwC3XlXUXoykWBlv9QV5HnO+ql3HvrrgfBJ7WXdnjO9iGPR2aAc5sw==",
"dev": true,
"requires": {
+ "@webassemblyjs/ast": "1.4.3",
+ "@webassemblyjs/wasm-edit": "1.4.3",
+ "@webassemblyjs/wasm-parser": "1.4.3",
"acorn": "^5.0.0",
"acorn-dynamic-import": "^3.0.0",
"ajv": "^6.1.0",
@@ -12395,15 +12804,36 @@
},
"dependencies": {
"ajv": {
- "version": "6.4.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.4.0.tgz",
- "integrity": "sha1-06/3jpJ3VJdx2vAWTP9ISCt1T8Y=",
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.0.tgz",
+ "integrity": "sha512-VDUX1oSajablmiyFyED9L1DFndg0P9h7p1F+NO8FkIzei6EPrR6Zu1n18rd5P8PqaSRd/FrWv3G1TVBqpM83gA==",
"dev": true,
"requires": {
- "fast-deep-equal": "^1.0.0",
+ "fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.3.0",
- "uri-js": "^3.0.2"
+ "uri-js": "^4.2.1"
+ }
+ },
+ "fast-deep-equal": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
+ "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
+ "dev": true
+ },
+ "punycode": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz",
+ "integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=",
+ "dev": true
+ },
+ "uri-js": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.1.tgz",
+ "integrity": "sha512-jpKCA3HjsBfSDOEgxRDAxQCNyHfCPSbq57PqCkd3gAyBuPb3IWxw54EHncqESznIdqSetHfw3D7ylThu2Kcc9A==",
+ "dev": true,
+ "requires": {
+ "punycode": "^2.1.0"
}
}
}
@@ -12438,12 +12868,6 @@
"integrity": "sha512-UY7+9DPzlJ9VM8eY0b2TUZcZvF+1pO0hzMtAyjBYKhOmnvRlqYNYnWdtsMj0V16CGaMlpL0G1jnLbLo4AyotuQ==",
"dev": true
},
- "babylon": {
- "version": "6.18.0",
- "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz",
- "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
- "dev": true
- },
"braces": {
"version": "1.8.5",
"resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz",
@@ -12456,9 +12880,9 @@
}
},
"core-js": {
- "version": "2.5.5",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.5.tgz",
- "integrity": "sha1-sU3ek2xkDAV5prUMq8wTLdYSfjs=",
+ "version": "2.5.6",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.6.tgz",
+ "integrity": "sha512-lQUVfQi0aLix2xpyjrrJEvfuYCqPc/HwmTKsC/VNf8q0zsjX7SQZtp4+oRONN5Tsur9GDETPjj+Ub2iDiGZfSQ==",
"dev": true
},
"esprima": {
@@ -12485,21 +12909,6 @@
"is-extglob": "^1.0.0"
}
},
- "is-extglob": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz",
- "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=",
- "dev": true
- },
- "is-glob": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz",
- "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=",
- "dev": true,
- "requires": {
- "is-extglob": "^1.0.0"
- }
- },
"jscodeshift": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.4.1.tgz",
@@ -12584,9 +12993,9 @@
}
},
"webpack-cli": {
- "version": "2.0.15",
- "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-2.0.15.tgz",
- "integrity": "sha512-bjNeIUO51D4OsmZ5ufzcpzVoacjxfWNfeBZKYL3jc+EMfCME3TyfdCPSUoKiOnebQChfupQuIRpAnx7L4l3Hew==",
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-2.1.3.tgz",
+ "integrity": "sha512-5AsKoL/Ccn8iTrwk3uErdyhetGH+c7VRQ7Itim2GL0IhBRq5rtojVDk00buMRmFmBpw1RvHXq97Gup965LbozA==",
"dev": true,
"requires": {
"chalk": "^2.3.2",
@@ -12614,7 +13023,7 @@
"webpack-addons": "^1.1.5",
"yargs": "^11.1.0",
"yeoman-environment": "^2.0.0",
- "yeoman-generator": "^2.0.3"
+ "yeoman-generator": "^2.0.4"
},
"dependencies": {
"ansi-regex": {
@@ -13132,26 +13541,26 @@
}
},
"yeoman-generator": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/yeoman-generator/-/yeoman-generator-2.0.4.tgz",
- "integrity": "sha512-Sgvz3MAkOpEIobcpW3rjEl6bOTNnl8SkibP9z7hYKfIGIlw0QDC2k0MAeXvyE2pLqc2M0Duql+6R7/W9GrJojg==",
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/yeoman-generator/-/yeoman-generator-2.0.5.tgz",
+ "integrity": "sha512-rV6tJ8oYzm4mmdF2T3wjY+Q42jKF2YiiD0VKfJ8/0ZYwmhCKC9Xs2346HVLPj/xE13i68psnFJv7iS6gWRkeAg==",
"dev": true,
"requires": {
"async": "^2.6.0",
"chalk": "^2.3.0",
"cli-table": "^0.3.1",
- "cross-spawn": "^5.1.0",
+ "cross-spawn": "^6.0.5",
"dargs": "^5.1.0",
- "dateformat": "^3.0.2",
+ "dateformat": "^3.0.3",
"debug": "^3.1.0",
"detect-conflict": "^1.0.0",
"error": "^7.0.2",
"find-up": "^2.1.0",
"github-username": "^4.0.0",
- "istextorbinary": "^2.1.0",
- "lodash": "^4.17.4",
+ "istextorbinary": "^2.2.1",
+ "lodash": "^4.17.10",
"make-dir": "^1.1.0",
- "mem-fs-editor": "^3.0.2",
+ "mem-fs-editor": "^4.0.0",
"minimist": "^1.2.0",
"pretty-bytes": "^4.0.2",
"read-chunk": "^2.1.0",
@@ -13194,12 +13603,14 @@
}
},
"cross-spawn": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
- "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
+ "version": "6.0.5",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
+ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
- "lru-cache": "^4.0.1",
+ "nice-try": "^1.0.4",
+ "path-key": "^2.0.1",
+ "semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
diff --git a/package.json b/package.json
index c94abaefe..ed17cb2f1 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"react": "16.3.2",
"react-dom": "16.3.2",
"react-textarea-autosize": "6.1.0",
- "react-toastify": "4.0.0-rc.5",
+ "react-toastify": "4.0.1",
"semantic-ui-css": "2.2.14",
"semantic-ui-react": "0.79.1"
},
@@ -16,7 +16,7 @@
"@types/jest": "22.2.3",
"@types/jsdom": "^11.0.4",
"@types/markdown-it": "0.0.4",
- "@types/node": "9.6.7",
+ "@types/node": "10.0.8",
"@types/react": "16.3.13",
"@types/react-dom": "16.0.5",
"@types/react-textarea-autosize": "4.3.2",
@@ -32,16 +32,16 @@
"reflect-metadata": "0.1.12",
"sass-loader": "7.0.1",
"selenium-webdriver": "3.6.0",
- "ts-jest": "22.4.4",
- "ts-loader": "4.2.0",
- "tslint": "5.9.1",
+ "ts-jest": "22.4.6",
+ "ts-loader": "4.3.0",
+ "tslint": "5.10.0",
"tslint-config-prettier": "1.12.0",
"tslint-plugin-prettier": "1.3.0",
"tslint-react": "3.5.1",
"typescript": "2.8.3",
- "webpack": "4.6.0",
+ "webpack": "4.8.3",
"webpack-clean-obsolete-chunks": "0.4.0",
- "webpack-cli": "2.0.15"
+ "webpack-cli": "2.1.3"
},
"jest": {
"transform": {
diff --git a/public/assets/styles/form.scss b/public/assets/styles/form.scss
deleted file mode 100644
index 033942604..000000000
--- a/public/assets/styles/form.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-.field {
- .info {
- padding: 5px 0px 0px 5px;
- }
- .info.clickable {
- color: $link-color;
- }
-}
-
-textarea {
- resize: none !important;
-}
\ No newline at end of file
diff --git a/public/assets/styles/global.scss b/public/assets/styles/global.scss
deleted file mode 100644
index 028806cf8..000000000
--- a/public/assets/styles/global.scss
+++ /dev/null
@@ -1,57 +0,0 @@
-@import 'variables.scss';
-
-.gm-text {
- color: $text-color;
-}
-
-.gm-text-lighter {
- color: $gray-darker;
-}
-
-.gm-primary,
-.gm-primary-hover:hover {
- color: $main-color;
-}
-
-.gm-staff {
- font-weight: 700;
- color: $admin-color;
- border-color: $admin-color;
-}
-
-.gm-status-label {
- text-transform: uppercase;
- color: $white;
- display: inline-block;
- line-height: 1;
- padding: 5px 4px;
- font-weight: 700;
- border: none;
- border-radius: 3px;
- font-size: $font-size-micro;
-}
-
-.gm-status-open {
- color: $text-color;
- background-color: #e8e8e8;
-}
-
-.gm-status-planned {
- background-color: #6435c9;
-}
-
-.gm-status-started {
- background-color: #2185d0;
-}
-
-.gm-status-completed {
- background-color: #21ba45;
-}
-
-.gm-status-declined {
- background-color: #db2828
-}
-
-.gm-status-duplicate {
- background-color: #fbbd08;
-}
\ No newline at end of file
diff --git a/public/assets/styles/grid.scss b/public/assets/styles/grid.scss
new file mode 100644
index 000000000..8b57a5068
--- /dev/null
+++ b/public/assets/styles/grid.scss
@@ -0,0 +1,457 @@
+// Container Size
+
+.container {
+ display: block;
+ max-width: 100% !important;
+}
+
+@include media("sm") {
+ .container {
+ width: auto !important;
+ margin-left: 10px !important;
+ margin-right: 10px !important;
+ }
+}
+
+@include media("md") {
+ .container {
+ width: 723px;
+ margin-left: auto !important;
+ margin-right: auto !important;
+ }
+}
+
+@include media("lg") {
+ .container {
+ width: 933px;
+ margin-left: auto !important;
+ margin-right: auto !important;
+ }
+}
+
+@include media("xl") {
+ .container {
+ width: 1140px;
+ margin-left: auto !important;
+ margin-right: auto !important;
+ }
+}
+
+.row {
+ display: -ms-flexbox;
+ display: flex;
+ -ms-flex-wrap: wrap;
+ flex-wrap: wrap;
+ margin-right: -10px;
+ margin-left: -10px;
+
+ .row > [class*="col-"] {
+ padding-top: 0;
+ padding-bottom: 0;
+ }
+}
+
+.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col,
+.col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm,
+.col-sm-auto, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md,
+.col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg,
+.col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl,
+.col-xl-auto {
+ position: relative;
+ width: 100%;
+ min-height: 1px;
+ padding: 10px;
+}
+
+
+.col {
+ -ms-flex-preferred-size: 0;
+ flex-basis: 0;
+ -ms-flex-positive: 1;
+ flex-grow: 1;
+ max-width: 100%;
+}
+
+.col-auto {
+ -ms-flex: 0 0 auto;
+ flex: 0 0 auto;
+ width: auto;
+ max-width: none;
+}
+
+.col-1 {
+ -ms-flex: 0 0 8.333333%;
+ flex: 0 0 8.333333%;
+ max-width: 8.333333%;
+}
+
+.col-2 {
+ -ms-flex: 0 0 16.666667%;
+ flex: 0 0 16.666667%;
+ max-width: 16.666667%;
+}
+
+.col-3 {
+ -ms-flex: 0 0 25%;
+ flex: 0 0 25%;
+ max-width: 25%;
+}
+
+.col-4 {
+ -ms-flex: 0 0 33.333333%;
+ flex: 0 0 33.333333%;
+ max-width: 33.333333%;
+}
+
+.col-5 {
+ -ms-flex: 0 0 41.666667%;
+ flex: 0 0 41.666667%;
+ max-width: 41.666667%;
+}
+
+.col-6 {
+ -ms-flex: 0 0 50%;
+ flex: 0 0 50%;
+ max-width: 50%;
+}
+
+.col-7 {
+ -ms-flex: 0 0 58.333333%;
+ flex: 0 0 58.333333%;
+ max-width: 58.333333%;
+}
+
+.col-8 {
+ -ms-flex: 0 0 66.666667%;
+ flex: 0 0 66.666667%;
+ max-width: 66.666667%;
+}
+
+.col-9 {
+ -ms-flex: 0 0 75%;
+ flex: 0 0 75%;
+ max-width: 75%;
+}
+
+.col-10 {
+ -ms-flex: 0 0 83.333333%;
+ flex: 0 0 83.333333%;
+ max-width: 83.333333%;
+}
+
+.col-11 {
+ -ms-flex: 0 0 91.666667%;
+ flex: 0 0 91.666667%;
+ max-width: 91.666667%;
+}
+
+.col-12 {
+ -ms-flex: 0 0 100%;
+ flex: 0 0 100%;
+ max-width: 100%;
+}
+
+@include media(">=sm") {
+ .col-sm {
+ -ms-flex-preferred-size: 0;
+ flex-basis: 0;
+ -ms-flex-positive: 1;
+ flex-grow: 1;
+ max-width: 100%;
+ }
+ .col-sm-auto {
+ -ms-flex: 0 0 auto;
+ flex: 0 0 auto;
+ width: auto;
+ max-width: none;
+ }
+ .col-sm-1 {
+ -ms-flex: 0 0 8.333333%;
+ flex: 0 0 8.333333%;
+ max-width: 8.333333%;
+ }
+ .col-sm-2 {
+ -ms-flex: 0 0 16.666667%;
+ flex: 0 0 16.666667%;
+ max-width: 16.666667%;
+ }
+ .col-sm-3 {
+ -ms-flex: 0 0 25%;
+ flex: 0 0 25%;
+ max-width: 25%;
+ }
+ .col-sm-4 {
+ -ms-flex: 0 0 33.333333%;
+ flex: 0 0 33.333333%;
+ max-width: 33.333333%;
+ }
+ .col-sm-5 {
+ -ms-flex: 0 0 41.666667%;
+ flex: 0 0 41.666667%;
+ max-width: 41.666667%;
+ }
+ .col-sm-6 {
+ -ms-flex: 0 0 50%;
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+ .col-sm-7 {
+ -ms-flex: 0 0 58.333333%;
+ flex: 0 0 58.333333%;
+ max-width: 58.333333%;
+ }
+ .col-sm-8 {
+ -ms-flex: 0 0 66.666667%;
+ flex: 0 0 66.666667%;
+ max-width: 66.666667%;
+ }
+ .col-sm-9 {
+ -ms-flex: 0 0 75%;
+ flex: 0 0 75%;
+ max-width: 75%;
+ }
+ .col-sm-10 {
+ -ms-flex: 0 0 83.333333%;
+ flex: 0 0 83.333333%;
+ max-width: 83.333333%;
+ }
+ .col-sm-11 {
+ -ms-flex: 0 0 91.666667%;
+ flex: 0 0 91.666667%;
+ max-width: 91.666667%;
+ }
+ .col-sm-12 {
+ -ms-flex: 0 0 100%;
+ flex: 0 0 100%;
+ max-width: 100%;
+ }
+}
+
+@include media(">=md") {
+ .col-md {
+ -ms-flex-preferred-size: 0;
+ flex-basis: 0;
+ -ms-flex-positive: 1;
+ flex-grow: 1;
+ max-width: 100%;
+ }
+ .col-md-auto {
+ -ms-flex: 0 0 auto;
+ flex: 0 0 auto;
+ width: auto;
+ max-width: none;
+ }
+ .col-md-1 {
+ -ms-flex: 0 0 8.333333%;
+ flex: 0 0 8.333333%;
+ max-width: 8.333333%;
+ }
+ .col-md-2 {
+ -ms-flex: 0 0 16.666667%;
+ flex: 0 0 16.666667%;
+ max-width: 16.666667%;
+ }
+ .col-md-3 {
+ -ms-flex: 0 0 25%;
+ flex: 0 0 25%;
+ max-width: 25%;
+ }
+ .col-md-4 {
+ -ms-flex: 0 0 33.333333%;
+ flex: 0 0 33.333333%;
+ max-width: 33.333333%;
+ }
+ .col-md-5 {
+ -ms-flex: 0 0 41.666667%;
+ flex: 0 0 41.666667%;
+ max-width: 41.666667%;
+ }
+ .col-md-6 {
+ -ms-flex: 0 0 50%;
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+ .col-md-7 {
+ -ms-flex: 0 0 58.333333%;
+ flex: 0 0 58.333333%;
+ max-width: 58.333333%;
+ }
+ .col-md-8 {
+ -ms-flex: 0 0 66.666667%;
+ flex: 0 0 66.666667%;
+ max-width: 66.666667%;
+ }
+ .col-md-9 {
+ -ms-flex: 0 0 75%;
+ flex: 0 0 75%;
+ max-width: 75%;
+ }
+ .col-md-10 {
+ -ms-flex: 0 0 83.333333%;
+ flex: 0 0 83.333333%;
+ max-width: 83.333333%;
+ }
+ .col-md-11 {
+ -ms-flex: 0 0 91.666667%;
+ flex: 0 0 91.666667%;
+ max-width: 91.666667%;
+ }
+ .col-md-12 {
+ -ms-flex: 0 0 100%;
+ flex: 0 0 100%;
+ max-width: 100%;
+ }
+}
+
+@include media(">=lg") {
+ .col-lg {
+ -ms-flex-preferred-size: 0;
+ flex-basis: 0;
+ -ms-flex-positive: 1;
+ flex-grow: 1;
+ max-width: 100%;
+ }
+ .col-lg-auto {
+ -ms-flex: 0 0 auto;
+ flex: 0 0 auto;
+ width: auto;
+ max-width: none;
+ }
+ .col-lg-1 {
+ -ms-flex: 0 0 8.333333%;
+ flex: 0 0 8.333333%;
+ max-width: 8.333333%;
+ }
+ .col-lg-2 {
+ -ms-flex: 0 0 16.666667%;
+ flex: 0 0 16.666667%;
+ max-width: 16.666667%;
+ }
+ .col-lg-3 {
+ -ms-flex: 0 0 25%;
+ flex: 0 0 25%;
+ max-width: 25%;
+ }
+ .col-lg-4 {
+ -ms-flex: 0 0 33.333333%;
+ flex: 0 0 33.333333%;
+ max-width: 33.333333%;
+ }
+ .col-lg-5 {
+ -ms-flex: 0 0 41.666667%;
+ flex: 0 0 41.666667%;
+ max-width: 41.666667%;
+ }
+ .col-lg-6 {
+ -ms-flex: 0 0 50%;
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+ .col-lg-7 {
+ -ms-flex: 0 0 58.333333%;
+ flex: 0 0 58.333333%;
+ max-width: 58.333333%;
+ }
+ .col-lg-8 {
+ -ms-flex: 0 0 66.666667%;
+ flex: 0 0 66.666667%;
+ max-width: 66.666667%;
+ }
+ .col-lg-9 {
+ -ms-flex: 0 0 75%;
+ flex: 0 0 75%;
+ max-width: 75%;
+ }
+ .col-lg-10 {
+ -ms-flex: 0 0 83.333333%;
+ flex: 0 0 83.333333%;
+ max-width: 83.333333%;
+ }
+ .col-lg-11 {
+ -ms-flex: 0 0 91.666667%;
+ flex: 0 0 91.666667%;
+ max-width: 91.666667%;
+ }
+ .col-lg-12 {
+ -ms-flex: 0 0 100%;
+ flex: 0 0 100%;
+ max-width: 100%;
+ }
+}
+
+
+@include media("xl") {
+ .col-xl {
+ -ms-flex-preferred-size: 0;
+ flex-basis: 0;
+ -ms-flex-positive: 1;
+ flex-grow: 1;
+ max-width: 100%;
+ }
+ .col-xl-auto {
+ -ms-flex: 0 0 auto;
+ flex: 0 0 auto;
+ width: auto;
+ max-width: none;
+ }
+ .col-xl-1 {
+ -ms-flex: 0 0 8.333333%;
+ flex: 0 0 8.333333%;
+ max-width: 8.333333%;
+ }
+ .col-xl-2 {
+ -ms-flex: 0 0 16.666667%;
+ flex: 0 0 16.666667%;
+ max-width: 16.666667%;
+ }
+ .col-xl-3 {
+ -ms-flex: 0 0 25%;
+ flex: 0 0 25%;
+ max-width: 25%;
+ }
+ .col-xl-4 {
+ -ms-flex: 0 0 33.333333%;
+ flex: 0 0 33.333333%;
+ max-width: 33.333333%;
+ }
+ .col-xl-5 {
+ -ms-flex: 0 0 41.666667%;
+ flex: 0 0 41.666667%;
+ max-width: 41.666667%;
+ }
+ .col-xl-6 {
+ -ms-flex: 0 0 50%;
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+ .col-xl-7 {
+ -ms-flex: 0 0 58.333333%;
+ flex: 0 0 58.333333%;
+ max-width: 58.333333%;
+ }
+ .col-xl-8 {
+ -ms-flex: 0 0 66.666667%;
+ flex: 0 0 66.666667%;
+ max-width: 66.666667%;
+ }
+ .col-xl-9 {
+ -ms-flex: 0 0 75%;
+ flex: 0 0 75%;
+ max-width: 75%;
+ }
+ .col-xl-10 {
+ -ms-flex: 0 0 83.333333%;
+ flex: 0 0 83.333333%;
+ max-width: 83.333333%;
+ }
+ .col-xl-11 {
+ -ms-flex: 0 0 91.666667%;
+ flex: 0 0 91.666667%;
+ max-width: 91.666667%;
+ }
+ .col-xl-12 {
+ -ms-flex: 0 0 100%;
+ flex: 0 0 100%;
+ max-width: 100%;
+ }
+}
\ No newline at end of file
diff --git a/public/assets/styles/main.scss b/public/assets/styles/main.scss
index 734bd40ec..b7814b2a1 100644
--- a/public/assets/styles/main.scss
+++ b/public/assets/styles/main.scss
@@ -1,7 +1,143 @@
@import 'variables.scss';
-@import 'global.scss';
-@import 'form.scss';
-@import 'semantic.scss';
+@import 'reset.scss';
+@import 'grid.scss';
+
+/*******************************
+ Site
+*******************************/
+
+html,
+body {
+ height: 100%;
+}
+html {
+ font-size: 14px;
+}
+body {
+ margin: 0px;
+ padding: 0px;
+ overflow-x: hidden;
+ min-width: 320px;
+ font-size: 14px;
+ font-family: $font-site;
+ background-color: $bg-color;
+ color: $text-color;
+ font-size: $font-size;
+}
+
+/*******************************
+ Headers
+*******************************/
+
+h1, h2, h3, h4, h5 {
+ line-height: 18px;
+ margin: 25px 0em 14px;
+ font-weight: 600;
+ padding: 0;
+}
+h1 {
+ line-height: 28px;
+ font-size: 28px;
+}
+h2 {
+ font-size: 24px;
+}
+h3 {
+ font-size: 20px;
+}
+h4 {
+ font-size: 16px;
+}
+h5 {
+ font-size: 14px;
+}
+h1:first-child,
+h2:first-child,
+h3:first-child,
+h4:first-child,
+h5:first-child {
+ margin-top: 0;
+}
+h1:last-child,
+h2:last-child,
+h3:last-child,
+h4:last-child,
+h5:last-child {
+ margin-bottom: 0;
+}
+
+/*******************************
+ Text
+*******************************/
+
+p {
+ margin: 0 0 14px;
+ line-height: 18px;
+}
+p:first-child {
+ margin-top: 0;
+}
+p:last-child {
+ margin-bottom: 0;
+}
+
+/*******************************
+ Links
+*******************************/
+
+a {
+ color: $link-color;
+ text-decoration: none;
+}
+a:hover {
+ color: darken($link-color, 10%);
+ text-decoration: none;
+}
+
+/*******************************
+ Stauses
+*******************************/
+
+.status-label {
+ text-transform: uppercase;
+ color: $white;
+ display: inline-block;
+ line-height: 1;
+ padding: 5px 4px;
+ font-weight: 600;
+ border: none;
+ border-radius: 3px;
+ font-size: $font-size-micro;
+}
+
+.status-open {
+ color: $text-color;
+ background-color: #e8e8e8;
+}
+
+.status-planned {
+ background-color: #6435c9;
+}
+
+.status-started {
+ background-color: #2185d0;
+}
+
+.status-completed {
+ background-color: #21ba45;
+}
+
+.status-declined {
+ background-color: #db2828
+}
+
+.status-duplicate {
+ background-color: #fbbd08;
+}
+
+/*******************************
+ Others
+*******************************/
.center {
text-align: center;
@@ -16,6 +152,10 @@
-webkit-appearance: button;
}
+.page {
+ margin-top: 30px;
+}
+
.page::after {
content: "";
clear: both;
@@ -26,28 +166,27 @@ noscript {
margin-top: 20px;
}
-body {
- background-color: $bg-color;
- color: $text-color;
-}
-
code {
- font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
+ font-family: $font-code;
}
body, h1, h2, h3, h4, h5, .ui, input {
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Helvetica Neue", Helvetica, sans-serif;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
}
+h1, h2, h3, h4, h5 {
+ font-weight: 600;
+}
+
.info {
font-size: 80%;
- color: rgba($text-color, .7);
+ color: rgba($text-color, .8);
}
-.info.right {
+.right {
float: right;
+ vertical-align: middle;
}
.center {
@@ -58,19 +197,21 @@ body, h1, h2, h3, h4, h5, .ui, input {
cursor: pointer;
}
-.ui.menu .subtitle,
.subtitle {
- font-size: 11px;
+ font-size: $font-size-tiny;
+ margin-bottom: 5px;
font-weight: 600;
letter-spacing: .3px;
text-transform: uppercase;
color: #999;
-}
-
-.subtitle {
display: block;
&.active {
cursor: pointer;
+ &:hover {
+ i {
+ color: $main-color;
+ }
+ }
i {
float: right;
}
@@ -121,42 +262,6 @@ body, h1, h2, h3, h4, h5, .ui, input {
}
}
-.ui.segment.c-response {
- padding: 0.5em;
-
- .content {
- margin-top: 10px;
- }
-
- .c-avatar {
- margin-left: 3px;
- }
-
- span.date {
- margin-left: 6px;
- }
-}
-
-.ui[class*="top pointing"].label:before,
-.ui[class*="pointing above"].label:before ,
-.ui[class*="bottom pointing"].label:before,
-.ui[class*="pointing below"].label:before {
- left: 20px;
-}
-
-.display-error {
- padding: 0;
- ul {
- padding: 0;
- margin: 0;
- list-style-type: none;
- text-align: left;
- li {
- padding-top: 5px;
- }
- }
-}
-
.ui.basic.red.label {
width: 100%;
color: #ef7878 !important;
@@ -175,17 +280,13 @@ body, h1, h2, h3, h4, h5, .ui, input {
}
}
-.signin-options{
- .ui.stackable.grid>.column:not(.row),
- .column {
- padding: 10px 5px !important;
- }
-}
-
.failure-page {
height: 60%;
+ text-align: center;
+ margin-top: 100px;
p {
font-size: 150%;
+ line-height: 30px;
}
h1 {
font-size: 200%;
@@ -197,12 +298,40 @@ body, h1, h2, h3, h4, h5, .ui, input {
}
}
+.c-divider {
+ display: table;
+ font-weight: 700;
+ margin: 15px 0px;
+
+ &::before, &::after {
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaAAAAACCAYAAACuTHuKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1OThBRDY4OUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1OThBRDY4QUNDMTYxMUU0OUE3NUVGOEJDMzMzMjE2NyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjU5OEFENjg3Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjU5OEFENjg4Q0MxNjExRTQ5QTc1RUY4QkMzMzMyMTY3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+VU513gAAADVJREFUeNrs0DENACAQBDBIWLGBJQby/mUcJn5sJXQmOQMAAAAAAJqt+2prAAAAAACg2xdgANk6BEVuJgyMAAAAAElFTkSuQmCC);
+ content: '';
+ display: table-cell;
+ position: relative;
+ top: 50%;
+ width: 50%;
+ background-repeat: no-repeat;
+ }
+ &::before {
+ background-position: right 1em top 50%;
+ }
+ &::after {
+ background-position: left 1em top 50%;
+ }
+}
+
.c-toast {
border-radius: 5px !important;
}
-.desktop-only {
- @include media("<desktop") {
+@include media("sm") {
+ .hidden-sm {
+ display: none;
+ }
+}
+
+@include media("md") {
+ .hidden-md {
display: none;
}
}
\ No newline at end of file
diff --git a/public/assets/styles/reset.scss b/public/assets/styles/reset.scss
new file mode 100644
index 000000000..d9e1f3aaf
--- /dev/null
+++ b/public/assets/styles/reset.scss
@@ -0,0 +1,14 @@
+@-ms-viewport {
+ width: device-width;
+}
+
+html {
+ box-sizing: border-box;
+ -ms-overflow-style: scrollbar;
+}
+
+*,
+*::before,
+*::after {
+ box-sizing: inherit;
+}
\ No newline at end of file
diff --git a/public/assets/styles/semantic.scss b/public/assets/styles/semantic.scss
deleted file mode 100644
index e981fa07d..000000000
--- a/public/assets/styles/semantic.scss
+++ /dev/null
@@ -1,37 +0,0 @@
-@import 'variables.scss';
-
-.ui.form textarea:not([rows]) {
- max-height: initial;
-}
-
-.ui.vertical.menu {
- .active.item {
- color: $admin-color;
- border-left: 2px solid $admin-color;
- font-weight: 700;
- background-color: $menu-color;
- &:hover {
- color: $admin-color;
- }
- }
-}
-
-.ui.list {
- .item {
- .showover {
- visibility: hidden;
- }
- &:hover {
- .showover {
- visibility: visible;
- }
- }
- }
-}
-
-
-.ui.label {
- .icon {
- margin-right: 0.25em;
- }
-}
\ No newline at end of file
diff --git a/public/assets/styles/variables.scss b/public/assets/styles/variables.scss
index 5abba5e79..64b465861 100644
--- a/public/assets/styles/variables.scss
+++ b/public/assets/styles/variables.scss
@@ -7,48 +7,74 @@ $font-size-large: 16px;
$font-size-big: 18px;
$font-size-xlarge: 22px;
+$font-site: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Helvetica Neue", Helvetica, sans-serif;
+$font-code: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
+
$main-color: #0069ff;
$admin-color: #365899;
$bg-color: #fdfdfd;
$menu-color: #fff;
$text-color: #333;
$link-color: #07C;
+$focus-color: #85b7d9;
// Buttons
$white: #fff;
+$gray-lightest: rgba(0,0,0,.03);
$gray-lighter: #eee;
-$gray-darker: #d5d5d5;
+$gray-light: #d5d5d5;
+$gray: #d5d5d5;
+$gray-darker: rgba(0, 0, 0, 0.4);
+$gray-darkest: rgba(0, 0, 0, 0.5);
$green: #15CD72;
$green-darker: #0CB863;
$red: #db2828;
+$error: #ef7878;
// Queries
-$tablet-width: 768px;
-$desktop-width: 992px;
+$sm-width: 576px;
+$md-width: 768px;
+$lg-width: 992px;
+$xl-width: 1200px;
@mixin media($media) {
- @if $media == "phone" {
- @media only screen and (max-width: #{$tablet-width - 0.1px}) {
+ @if $media == "sm" {
+ @media only screen and (max-width: #{$md-width - 0.1px}) {
+ @content;
+ }
+ }
+ @else if $media == ">=sm" {
+ @media only screen and (min-width: #{$sm-width}) {
+ @content;
+ }
+ }
+ @else if $media == "md" {
+ @media only screen and (min-width: #{$md-width}) and (max-width: #{$lg-width - 0.1px}) {
+ @content;
+ }
+ }
+ @else if $media == ">=md" {
+ @media only screen and (min-width: #{$md-width}) {
@content;
}
}
- @else if $media == "tablet" {
- @media only screen and (min-width: #{$tablet-width}) and (max-width: #{$desktop-width - 0.1px}) {
+ @else if $media == "<lg" {
+ @media only screen and (max-width: #{$xl-width - 0.1px}) {
@content;
}
}
- @else if $media == ">tablet" {
- @media only screen and (min-width: #{$tablet-width}) {
+ @else if $media == "lg" {
+ @media only screen and (min-width: #{$lg-width}) and (max-width: #{$xl-width - 0.1px}) {
@content;
}
}
- @else if $media == "<desktop" {
- @media only screen and (max-width: #{$desktop-width - 0.1px}) {
+ @else if $media == ">=lg" {
+ @media only screen and (min-width: #{$lg-width}) {
@content;
}
}
- @else if $media == "desktop" {
- @media only screen and (min-width: #{$desktop-width}) {
+ @else if $media == "xl" {
+ @media only screen and (min-width: #{$xl-width}) {
@content;
}
}
diff --git a/public/components/ShowIdeaResponse.scss b/public/components/ShowIdeaResponse.scss
new file mode 100644
index 000000000..b26e1b606
--- /dev/null
+++ b/public/components/ShowIdeaResponse.scss
@@ -0,0 +1,15 @@
+.c-segment.l-response {
+ padding: 8px;
+
+ .content {
+ margin-top: 5px;
+ }
+
+ .c-avatar {
+ margin-left: 3px;
+ }
+
+ span.date {
+ margin-left: 3px;
+ }
+}
\ No newline at end of file
diff --git a/public/components/ShowIdeaResponse.tsx b/public/components/ShowIdeaResponse.tsx
index e510c8ae9..801a123c3 100644
--- a/public/components/ShowIdeaResponse.tsx
+++ b/public/components/ShowIdeaResponse.tsx
@@ -1,12 +1,17 @@
+import "./ShowIdeaResponse.scss";
+
import * as React from "react";
import { User, IdeaResponse, IdeaStatus } from "@fider/models";
-import { Gravatar, MultiLineText, Moment, UserName } from "@fider/components/common";
+import { Gravatar, MultiLineText, Moment, UserName, Segment } from "@fider/components/common";
-interface IdeaResponseProps {
- status: number;
- response: IdeaResponse;
+interface ShowIdeaStatusProps {
+ status: IdeaStatus;
}
+export const ShowIdeaStatus = (props: ShowIdeaStatusProps) => {
+ return <span className={`status-label status-${props.status.slug}`}>{props.status.title}</span>;
+};
+
const DuplicateDetails = (props: IdeaResponseProps): JSX.Element | null => {
const original = props.response.original;
if (!original) {
@@ -16,13 +21,16 @@ const DuplicateDetails = (props: IdeaResponseProps): JSX.Element | null => {
return (
<div className="content">
- <span>&#8618;</span>
- <span title={status.title} className={`status-${status.slug}`} />
- <a href={`/ideas/${original.number}/${original.slug}`}>{original.title}</a>
+ <span>&#8618;</span> <a href={`/ideas/${original.number}/${original.slug}`}>{original.title}</a>
</div>
);
};
+interface IdeaResponseProps {
+ status: number;
+ response: IdeaResponse;
+}
+
const StatusDetails = (props: IdeaResponseProps): JSX.Element => {
return (
<div className="content">
@@ -36,14 +44,14 @@ export const ShowIdeaResponse = (props: IdeaResponseProps): JSX.Element => {
if (props.response && status.show) {
return (
- <div className="c-response item ui segment">
- <span className={`gm-status-label gm-status-${status.slug}`}>{status.title}</span>
+ <Segment className="l-response">
+ <ShowIdeaStatus status={status} />
<Gravatar user={props.response.user} /> <UserName user={props.response.user} />
<span className="info">
<Moment date={props.response.respondedOn} />
</span>
{status === IdeaStatus.Duplicate ? DuplicateDetails(props) : StatusDetails(props)}
- </div>
+ </Segment>
);
}
diff --git a/public/components/ShowTag.scss b/public/components/ShowTag.scss
new file mode 100644
index 000000000..7db28fd3c
--- /dev/null
+++ b/public/components/ShowTag.scss
@@ -0,0 +1,69 @@
+@import '~@fider/assets/styles/variables.scss';
+
+.c-tag {
+ display: inline-block;
+ line-height: 1;
+ vertical-align: baseline;
+ margin: 0 3px;
+ padding: 9px 12px;
+ color: $text-color;
+ font-weight: 700;
+ border: 0;
+ border-radius: 5px;
+
+ &:first-child {
+ margin-left: 0;
+ }
+
+ &.m-circular {
+ min-height: 0;
+ min-width: 0;
+ overflow: hidden;
+ border-radius: 50px;
+
+ &.m-mini {
+ padding: 5px;
+ }
+
+ &.m-tiny {
+ padding: 6px;
+ }
+
+ &.m-small {
+ padding: 7px;
+ }
+
+ &.m-normal {
+ padding: 7.5px;
+ }
+
+ &.m-large {
+ padding: 8px;
+ }
+ }
+
+ &.m-mini {
+ font-size: 70%;
+ padding: 5px 8px;
+ }
+
+ &.m-tiny {
+ font-size: 80%;
+ padding: 6px 9px;
+ }
+
+ &.m-small {
+ font-size: 85%;
+ padding: 7px 10px;
+ }
+
+ &.m-normal {
+ font-size: 90%;
+ padding: 8px 11px;
+ }
+
+ &.m-large {
+ font-size: 100%;
+ padding: 9px 12px;
+ }
+}
\ No newline at end of file
diff --git a/public/components/ShowTag.tsx b/public/components/ShowTag.tsx
index 57724604b..88aca56bd 100644
--- a/public/components/ShowTag.tsx
+++ b/public/components/ShowTag.tsx
@@ -1,5 +1,8 @@
+import "./ShowTag.scss";
+
import * as React from "react";
import { Tag } from "@fider/models";
+import { classSet } from "@fider/services";
interface TagProps {
tag: Tag;
@@ -26,13 +29,16 @@ const idealTextColor = (color: string) => {
};
export const ShowTag = (props: TagProps) => {
- const formatClass = props.circular === true ? "empty circular" : "";
- const sizeClass = props.size || "normal";
+ const className = classSet({
+ "c-tag": true,
+ [`m-${props.size || "normal"}`]: true,
+ "m-circular": props.circular === true
+ });
return (
<div
title={`${props.tag.name}${!props.tag.isPublic ? " (Private)" : ""}`}
- className={`ui label ${sizeClass} ${formatClass}`}
+ className={className}
style={{
backgroundColor: `#${props.tag.color}`,
color: idealTextColor(props.tag.color)
diff --git a/public/components/SupportCounter.scss b/public/components/SupportCounter.scss
index 91b793fb0..a765e73a4 100644
--- a/public/components/SupportCounter.scss
+++ b/public/components/SupportCounter.scss
@@ -4,29 +4,36 @@
margin-right: 10px;
button,
- button.supported,
- button.disabled {
+ button.m-supported,
+ button.m-disabled {
font-size: 18px;
border: none;
width: 45px;
font-weight: 700;
cursor: pointer;
- background-color: transparent;
+ background-color: $bg-color;
text-align: center;
margin: 0 auto;
padding: 0 0;
- &:hover {
- .icon {
- color: inherit;
- }
+ i.icon {
+ color: #C4C9CD;
}
}
- button.disabled {
+ button.m-disabled {
@include disabled();
}
+ button.m-supported,
+ button.no-touch:hover {
+ color: $main-color;
+
+ i.icon {
+ color: lighten($main-color, 20%) !important;
+ }
+ }
+
i.icon {
margin: 0 auto;
display: block;
diff --git a/public/components/SupportCounter.tsx b/public/components/SupportCounter.tsx
index 014d016f9..97295d693 100644
--- a/public/components/SupportCounter.tsx
+++ b/public/components/SupportCounter.tsx
@@ -47,23 +47,14 @@ export class SupportCounter extends React.Component<SupportCounterProps, Support
const status = IdeaStatus.Get(this.props.idea.status);
const className = classSet({
- supported: !status.closed && this.state.supported,
- disabled: status.closed,
- "no-touch": !device.isTouch(),
- "gm-text": !this.state.supported,
- "gm-primary": this.state.supported,
- "gm-primary-hover": true
+ "m-supported": !status.closed && this.state.supported,
+ "m-disabled": status.closed,
+ "no-touch": !device.isTouch()
});
const vote = (
<button className={className} onClick={async () => await this.supportOrUndo()}>
- <i
- className={classSet({
- "medium caret up icon": true,
- "gm-text-lighter": !this.state.supported,
- "gm-primary": this.state.supported
- })}
- />
+ <i className="medium caret up icon" />
{this.state.total}
</button>
);
diff --git a/public/components/common/Button.scss b/public/components/common/Button.scss
index eb75c4b47..998e484d3 100644
--- a/public/components/common/Button.scss
+++ b/public/components/common/Button.scss
@@ -1,25 +1,27 @@
@import '~@fider/assets/styles/variables.scss';
.c-button {
+ line-height: 1.15;
+ display: inline-block;
cursor: pointer;
font-size: $font-size;
border-radius: 3px;
border: none;
margin: 0 4px 0 0;
- padding: 10px;
+ padding: 8px;
text-align: left;
- font-weight: 700;
+ font-weight: 600;
- &.default {
+ &.m-default {
color: $text-color;
background-color: $gray-lighter;
&:hover {
- background-color: $gray-darker;
+ background-color: $gray;
}
}
- &.positive {
+ &.m-positive {
color: $white;
background-color: $green;
@@ -28,7 +30,7 @@
}
}
- &.danger {
+ &.m-danger {
color: $red;
border: 1px solid $red;
background-color: transparent;
@@ -39,44 +41,37 @@
}
}
- &.mini {
- padding: 7px;
+ &.m-mini {
+ padding: 6px;
font-size: $font-size-mini;
}
- &.tiny {
- padding: 8px;
+ &.m-tiny {
+ padding: 7px;
font-size: $font-size-tiny;
}
- &.small {
- padding: 9px;
+ &.m-small {
+ padding: 8px;
font-size: $font-size-small;
}
- &.large {
- padding: 11px;
- font-size: $font-size-large;
+ &.m-normal {
+ padding: 9px;
+ font-size: $font-size;
}
- &.as-link {
- background-color: transparent;
- padding: 0;
- font-weight: 400;
- color: rgba($text-color, 0.6);
-
- &:hover {
- color: $text-color;
- text-decoration: underline;
- }
+ &.m-large {
+ padding: 10px;
+ font-size: $font-size-large;
}
- &.fluid {
+ &.m-fluid {
display: block;
width: 100%;
}
- &.loading {
+ &.m-loading {
position: relative;
cursor: default;
text-shadow: none !important;
@@ -119,11 +114,11 @@
}
}
- &.disabled {
+ &.m-disabled {
@include disabled();
}
- &.social {
+ &.m-social {
background-color: $white;
color: $text-color;
text-align: center;
@@ -138,19 +133,19 @@
margin-right: 5px;
}
- &.loading .svg {
+ &.m-loading .svg {
display: none;
}
- &.google .svg {
+ &.m-google .svg {
background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHg9IjBweCIgeT0iMHB4IgogICAgIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIKICAgICB2aWV3Qm94PSIwIDAgNDggNDgiCiAgICAgc3R5bGU9ImZpbGw6IzAwMDAwMDsiPjxnIGlkPSJzdXJmYWNlMSI+PHBhdGggc3R5bGU9IiBmaWxsOiNGRkMxMDc7IiBkPSJNIDQzLjYwOTM3NSAyMC4wODIwMzEgTCA0MiAyMC4wODIwMzEgTCA0MiAyMCBMIDI0IDIwIEwgMjQgMjggTCAzNS4zMDQ2ODggMjggQyAzMy42NTIzNDQgMzIuNjU2MjUgMjkuMjIyNjU2IDM2IDI0IDM2IEMgMTcuMzcxMDk0IDM2IDEyIDMwLjYyODkwNiAxMiAyNCBDIDEyIDE3LjM3MTA5NCAxNy4zNzEwOTQgMTIgMjQgMTIgQyAyNy4wNTg1OTQgMTIgMjkuODQzNzUgMTMuMTUyMzQ0IDMxLjk2MDkzOCAxNS4wMzkwNjMgTCAzNy42MTcxODggOS4zODI4MTMgQyAzNC4wNDY4NzUgNi4wNTQ2ODggMjkuMjY5NTMxIDQgMjQgNCBDIDEyLjk1MzEyNSA0IDQgMTIuOTUzMTI1IDQgMjQgQyA0IDM1LjA0Njg3NSAxMi45NTMxMjUgNDQgMjQgNDQgQyAzNS4wNDY4NzUgNDQgNDQgMzUuMDQ2ODc1IDQ0IDI0IEMgNDQgMjIuNjYwMTU2IDQzLjg2MzI4MSAyMS4zNTE1NjMgNDMuNjA5Mzc1IDIwLjA4MjAzMSBaICI+PC9wYXRoPjxwYXRoIHN0eWxlPSIgZmlsbDojRkYzRDAwOyIgZD0iTSA2LjMwNDY4OCAxNC42OTE0MDYgTCAxMi44Nzg5MDYgMTkuNTExNzE5IEMgMTQuNjU2MjUgMTUuMTA5Mzc1IDE4Ljk2MDkzOCAxMiAyNCAxMiBDIDI3LjA1ODU5NCAxMiAyOS44NDM3NSAxMy4xNTIzNDQgMzEuOTYwOTM4IDE1LjAzOTA2MyBMIDM3LjYxNzE4OCA5LjM4MjgxMyBDIDM0LjA0Njg3NSA2LjA1NDY4OCAyOS4yNjk1MzEgNCAyNCA0IEMgMTYuMzE2NDA2IDQgOS42NTYyNSA4LjMzNTkzOCA2LjMwNDY4OCAxNC42OTE0MDYgWiAiPjwvcGF0aD48cGF0aCBzdHlsZT0iIGZpbGw6IzRDQUY1MDsiIGQ9Ik0gMjQgNDQgQyAyOS4xNjQwNjMgNDQgMzMuODU5Mzc1IDQyLjAyMzQzOCAzNy40MTAxNTYgMzguODA4NTk0IEwgMzEuMjE4NzUgMzMuNTcwMzEzIEMgMjkuMjEwOTM4IDM1LjA4OTg0NCAyNi43MTQ4NDQgMzYgMjQgMzYgQyAxOC43OTY4NzUgMzYgMTQuMzgyODEzIDMyLjY4MzU5NCAxMi43MTg3NSAyOC4wNTQ2ODggTCA2LjE5NTMxMyAzMy4wNzgxMjUgQyA5LjUwMzkwNiAzOS41NTQ2ODggMTYuMjI2NTYzIDQ0IDI0IDQ0IFogIj48L3BhdGg+PHBhdGggc3R5bGU9IiBmaWxsOiMxOTc2RDI7IiBkPSJNIDQzLjYwOTM3NSAyMC4wODIwMzEgTCA0MiAyMC4wODIwMzEgTCA0MiAyMCBMIDI0IDIwIEwgMjQgMjggTCAzNS4zMDQ2ODggMjggQyAzNC41MTE3MTkgMzAuMjM4MjgxIDMzLjA3MDMxMyAzMi4xNjQwNjMgMzEuMjE0ODQ0IDMzLjU3MDMxMyBDIDMxLjIxODc1IDMzLjU3MDMxMyAzMS4yMTg3NSAzMy41NzAzMTMgMzEuMjE4NzUgMzMuNTcwMzEzIEwgMzcuNDEwMTU2IDM4LjgwODU5NCBDIDM2Ljk3MjY1NiAzOS4yMDMxMjUgNDQgMzQgNDQgMjQgQyA0NCAyMi42NjAxNTYgNDMuODYzMjgxIDIxLjM1MTU2MyA0My42MDkzNzUgMjAuMDgyMDMxIFogIj48L3BhdGg+PC9nPjwvc3ZnPg==') 50% 50% no-repeat;
}
- &.github .svg {
+ &.m-github .svg {
background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHg9IjBweCIgeT0iMHB4IgogICAgIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIKICAgICB2aWV3Qm94PSIwIDAgMzIgMzIiCiAgICAgc3R5bGU9ImZpbGw6IzAwMDAwMDsiPjxnIGlkPSJzdXJmYWNlMSI+PHBhdGggc3R5bGU9IiBmaWxsLXJ1bGU6ZXZlbm9kZDsiIGQ9Ik0gMTYgNCBDIDkuMzcxMDk0IDQgNCA5LjM3MTA5NCA0IDE2IEMgNCAyMS4zMDA3ODEgNy40Mzc1IDI1LjgwMDc4MSAxMi4yMDcwMzEgMjcuMzg2NzE5IEMgMTIuODA4NTk0IDI3LjQ5NjA5NCAxMy4wMjczNDQgMjcuMTI4OTA2IDEzLjAyNzM0NCAyNi44MDg1OTQgQyAxMy4wMjczNDQgMjYuNTIzNDM4IDEzLjAxNTYyNSAyNS43Njk1MzEgMTMuMDExNzE5IDI0Ljc2OTUzMSBDIDkuNjcxODc1IDI1LjQ5MjE4OCA4Ljk2ODc1IDIzLjE2MDE1NiA4Ljk2ODc1IDIzLjE2MDE1NiBDIDguNDIxODc1IDIxLjc3MzQzOCA3LjYzNjcxOSAyMS40MDIzNDQgNy42MzY3MTkgMjEuNDAyMzQ0IEMgNi41NDY4NzUgMjAuNjYwMTU2IDcuNzE4NzUgMjAuNjc1NzgxIDcuNzE4NzUgMjAuNjc1NzgxIEMgOC45MjE4NzUgMjAuNzYxNzE5IDkuNTU0Njg4IDIxLjkxMDE1NiA5LjU1NDY4OCAyMS45MTAxNTYgQyAxMC42MjUgMjMuNzQ2MDk0IDEyLjM2MzI4MSAyMy4yMTQ4NDQgMTMuMDQ2ODc1IDIyLjkxMDE1NiBDIDEzLjE1NjI1IDIyLjEzMjgxMyAxMy40Njg3NSAyMS42MDU0NjkgMTMuODA4NTk0IDIxLjMwNDY4OCBDIDExLjE0NDUzMSAyMS4wMDM5MDYgOC4zNDM3NSAxOS45NzI2NTYgOC4zNDM3NSAxNS4zNzUgQyA4LjM0Mzc1IDE0LjA2MjUgOC44MTI1IDEyLjk5MjE4OCA5LjU3ODEyNSAxMi4xNTIzNDQgQyA5LjQ1NzAzMSAxMS44NTE1NjMgOS4wNDI5NjkgMTAuNjI4OTA2IDkuNjk1MzEzIDguOTc2NTYzIEMgOS42OTUzMTMgOC45NzY1NjMgMTAuNzAzMTI1IDguNjU2MjUgMTIuOTk2MDk0IDEwLjIwNzAzMSBDIDEzLjk1MzEyNSA5Ljk0MTQwNiAxNC45ODA0NjkgOS44MDg1OTQgMTYgOS44MDQ2ODggQyAxNy4wMTk1MzEgOS44MDg1OTQgMTguMDQ2ODc1IDkuOTQxNDA2IDE5LjAwMzkwNiAxMC4yMDcwMzEgQyAyMS4yOTY4NzUgOC42NTYyNSAyMi4zMDA3ODEgOC45NzY1NjMgMjIuMzAwNzgxIDguOTc2NTYzIEMgMjIuOTU3MDMxIDEwLjYyODkwNiAyMi41NDY4NzUgMTEuODUxNTYzIDIyLjQyMTg3NSAxMi4xNTIzNDQgQyAyMy4xOTE0MDYgMTIuOTkyMTg4IDIzLjY1MjM0NCAxNC4wNjI1IDIzLjY1MjM0NCAxNS4zNzUgQyAyMy42NTIzNDQgMTkuOTg0Mzc1IDIwLjg0NzY1NiAyMC45OTYwOTQgMTguMTc1NzgxIDIxLjI5Njg3NSBDIDE4LjYwNTQ2OSAyMS42NjQwNjMgMTguOTg4MjgxIDIyLjM5ODQzOCAxOC45ODgyODEgMjMuNTE1NjI1IEMgMTguOTg4MjgxIDI1LjEyMTA5NCAxOC45NzY1NjMgMjYuNDE0MDYzIDE4Ljk3NjU2MyAyNi44MDg1OTQgQyAxOC45NzY1NjMgMjcuMTI4OTA2IDE5LjE5MTQwNiAyNy41MDM5MDYgMTkuODAwNzgxIDI3LjM4NjcxOSBDIDI0LjU2NjQwNiAyNS43OTY4NzUgMjggMjEuMzAwNzgxIDI4IDE2IEMgMjggOS4zNzEwOTQgMjIuNjI4OTA2IDQgMTYgNCBaICI+PC9wYXRoPjwvZz48L3N2Zz4=') 50% 50% no-repeat;
}
- &.facebook .svg {
+ &.m-facebook .svg {
background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHg9IjBweCIgeT0iMHB4IgogICAgIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIKICAgICB2aWV3Qm94PSIwIDAgNDggNDgiCiAgICAgc3R5bGU9ImZpbGw6IzAwMDAwMDsiPjxnIGlkPSJzdXJmYWNlMSI+PHBhdGggc3R5bGU9IiBmaWxsOiMzRjUxQjU7IiBkPSJNIDQyIDM3IEMgNDIgMzkuNzYxNzE5IDM5Ljc2MTcxOSA0MiAzNyA0MiBMIDExIDQyIEMgOC4yMzgyODEgNDIgNiAzOS43NjE3MTkgNiAzNyBMIDYgMTEgQyA2IDguMjM4MjgxIDguMjM4MjgxIDYgMTEgNiBMIDM3IDYgQyAzOS43NjE3MTkgNiA0MiA4LjIzODI4MSA0MiAxMSBaICI+PC9wYXRoPjxwYXRoIHN0eWxlPSIgZmlsbDojRkZGRkZGOyIgZD0iTSAzNC4zNjcxODggMjUgTCAzMSAyNSBMIDMxIDM4IEwgMjYgMzggTCAyNiAyNSBMIDIzIDI1IEwgMjMgMjEgTCAyNiAyMSBMIDI2IDE4LjU4OTg0NCBDIDI2LjAwMzkwNiAxNS4wODIwMzEgMjcuNDYwOTM4IDEzIDMxLjU5Mzc1IDEzIEwgMzUgMTMgTCAzNSAxNyBMIDMyLjcxNDg0NCAxNyBDIDMxLjEwNTQ2OSAxNyAzMSAxNy42MDE1NjMgMzEgMTguNzIyNjU2IEwgMzEgMjEgTCAzNSAyMSBaICI+PC9wYXRoPjwvZz48L3N2Zz4=') 50% 50% no-repeat;
}
diff --git a/public/components/common/Button.tsx b/public/components/common/Button.tsx
index f6cb613df..b7ee9cb31 100644
--- a/public/components/common/Button.tsx
+++ b/public/components/common/Button.tsx
@@ -3,7 +3,6 @@ import { classSet } from "@fider/services";
interface ButtonProps {
className?: string;
- simple?: boolean;
disabled?: boolean;
href?: string;
color?: "positive" | "danger" | "default";
@@ -48,7 +47,7 @@ export class Button extends React.Component<ButtonProps, ButtonState> {
this.unmounted = true;
}
- public async click(e?: React.MouseEvent<HTMLButtonElement>) {
+ public click = async (e?: React.SyntheticEvent<HTMLElement>) => {
if (e) {
e.preventDefault();
e.stopPropagation();
@@ -66,17 +65,16 @@ export class Button extends React.Component<ButtonProps, ButtonState> {
this.setState({ clicked: false });
}
}
- }
+ };
public render() {
const className = classSet({
"c-button": true,
- "as-link": this.props.simple,
- fluid: this.props.fluid,
- [this.props.size!]: this.props.size,
- [this.props.color!]: this.props.color,
- loading: this.state.clicked,
- disabled: this.state.clicked || this.props.disabled,
+ "m-fluid": this.props.fluid,
+ [`m-${this.props.size}`]: this.props.size,
+ [`m-${this.props.color}`]: this.props.color,
+ "m-loading": this.state.clicked,
+ "m-disabled": this.state.clicked || this.props.disabled,
[this.props.className!]: this.props.className
});
@@ -88,7 +86,7 @@ export class Button extends React.Component<ButtonProps, ButtonState> {
);
} else {
return (
- <button type="button" className={className} onClick={e => this.click(e)}>
+ <button type="button" className={className} onClick={this.click}>
{this.props.children}
</button>
);
diff --git a/public/components/common/FiderVersion.tsx b/public/components/common/FiderVersion.tsx
index 7acb08d0e..30057eb58 100644
--- a/public/components/common/FiderVersion.tsx
+++ b/public/components/common/FiderVersion.tsx
@@ -3,7 +3,7 @@ import { page } from "@fider/services";
export const FiderVersion = () => {
return (
- <p className="info center desktop-only">
+ <p className="info center hidden-sm hidden-md">
Support our{" "}
<a target="_blank" href="http://opencollective.com/fider">
OpenCollective
diff --git a/public/components/common/Footer.tsx b/public/components/common/Footer.tsx
index bcd0c5133..73f5efa83 100644
--- a/public/components/common/Footer.tsx
+++ b/public/components/common/Footer.tsx
@@ -6,7 +6,7 @@ const logo = require("@fider/assets/images/logo-small.png");
export const Footer = () => {
return (
<div id="c-footer">
- <div className="ui container">
+ <div className="container">
<a target="_blank" href="https://getfider.com/">
<img src={logo} alt="Fider" />
<span>Powered by Fider</span>
diff --git a/public/components/common/Form.tsx b/public/components/common/Form.tsx
deleted file mode 100644
index 67b037b3c..000000000
--- a/public/components/common/Form.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import * as React from "react";
-import { Failure } from "@fider/services";
-import { DisplayError } from "./";
-
-interface FormProps {
- onSubmit?: () => Promise<any>;
-}
-
-interface FormState {
- failure?: Failure;
-}
-
-export class Form extends React.Component<FormProps, FormState> {
- public constructor(props: FormProps) {
- super(props);
- }
-
- public async submit(e?: React.FormEvent<HTMLFormElement>) {
- if (e) {
- e.preventDefault();
- }
- if (this.props.onSubmit) {
- await this.props.onSubmit();
- }
- }
-
- public async clearFailure() {
- this.setState({ failure: undefined });
- }
-
- public async setFailure(failure: Failure) {
- this.setState({ failure });
- }
-
- public render() {
- return (
- <form autoComplete="off" className="ui form" onSubmit={e => this.submit(e)}>
- <DisplayError error={this.state && this.state.failure} />
- {this.props.children}
- </form>
- );
- }
-}
diff --git a/public/components/common/Gravatar.scss b/public/components/common/Gravatar.scss
index cf9e9ec56..fb4c51981 100644
--- a/public/components/common/Gravatar.scss
+++ b/public/components/common/Gravatar.scss
@@ -6,8 +6,9 @@
height: 30px;
vertical-align: middle;
padding: 1px;
- &.gm-staff {
- border-width: 1px;
- border-style: solid;
+ display: inline-block;
+
+ &.m-staff {
+ border: 1px solid $admin-color;
}
}
\ No newline at end of file
diff --git a/public/components/common/Gravatar.tsx b/public/components/common/Gravatar.tsx
index 5ec2ddd60..161cf0e74 100644
--- a/public/components/common/Gravatar.tsx
+++ b/public/components/common/Gravatar.tsx
@@ -17,7 +17,7 @@ export const Gravatar = (props: GravatarProps) => {
const className = classSet({
"c-avatar": true,
- "gm-staff": isCollaborator
+ "m-staff": isCollaborator
});
return <img className={className} title={name} src={url} />;
diff --git a/public/components/common/Header.scss b/public/components/common/Header.scss
index bf2ef2fa0..d16bd2483 100644
--- a/public/components/common/Header.scss
+++ b/public/components/common/Header.scss
@@ -1,12 +1,18 @@
@import '~@fider/assets/styles/variables.scss';
-#c-header {
- .ui.vertical.menu .item > .label {
- float: none;
- position: absolute;
- right: 5px;
- }
+@mixin menu-item {
+ position: relative;
+ vertical-align: middle;
+ line-height: 1;
+ text-decoration: none;
+ flex: 0 0 auto;
+ user-select: none;
+ padding: 15px 10px;
+ display: flex;
+ align-items: center;
+}
+#c-header {
.c-env-info {
padding: 2px;
border-radius: 0px;
@@ -16,36 +22,37 @@
background-color: rgba($red, 0.05);
}
- .ui.borderless.menu {
+ .c-menu {
margin-top: 0px;
height: 50px;
border-radius: 0px;
border: none;
- @include media("phone") {
- height: 30px;
- }
+ display: flex;
+ box-shadow: 0 1px 2px 0 rgba(34, 36, 38, 0.15);
+ margin-bottom: 10px;
- &:last-child {
- margin-bottom: 30px;
+ .container {
+ display: flex;
}
-
- .unread-dot {
- width: 10px;
- height: 10px;
- border-radius: 5px;
- margin-left: -10px;
- margin-top: -25px;
- background-color: #db2828;
- border: 1px solid #fff !important;
+
+ @include media("sm") {
+ height: 40px;
+ .container {
+ width: 100% !important;
+ margin-left: 0 !important;
+ margin-right: 0 !important;
+ }
}
-
- .title {
+
+ .c-menu-item-title {
+ @include menu-item;
+ color: #484848;
img {
margin-right: 10px;
width: auto;
height: auto;
max-height: 36px;
- @include media("phone") {
+ @include media("sm") {
max-height: 26px;
margin-right: 5px;
}
@@ -53,24 +60,94 @@
span {
font-size: $font-size-big;
margin: 0 0 0 0;
- color: #484848;
- font-weight: 700;
- @include media("phone") {
+ font-weight: 600;
+ @include media("sm") {
font-size: $font-size;
max-width: 240px;
}
}
}
- .signin {
+ .c-menu-item-signin {
+ @include menu-item;
+ cursor: pointer;
font-size: 90%;
- i.dropdown {
- margin: 0 0 0 0.5em;
+ margin-left: auto !important;
+ margin-bottom: 0;
+
+ &:hover {
+ color: $text-color;
}
- }
-
- .item:hover {
- background: transparent;
- }
+
+ .c-menu-user {
+ display: none;
+ position: absolute;
+ overflow: visible;
+ width: auto;
+ height: auto;
+ top: 100%!important;
+ opacity: 1;
+ z-index: 11;
+ background-color: $menu-color;
+ box-shadow: 0 1px 3px 0 rgba(0,0,0,.08);
+ border: 1px solid rgba(34,36,38,.15);
+ width: 160px;
+ border-radius: 0px 0px 5px 5px;
+
+ .c-menu-user-heading {
+ font-size: $font-size-mini;
+ padding: 10px;
+ display: block;
+ color: $text-color;
+ text-transform: uppercase;
+ font-weight: 600;
+ cursor: default;
+ }
+ .c-menu-user-item {
+ font-size: $font-size-small;
+ padding: 10px;
+ display: block;
+ color: $text-color;
+ &:hover {
+ background-color: $gray-lightest;
+ }
+ }
+ .c-menu-user-divider {
+ border-top: 1px solid rgba(34,36,38,.1);
+ display: block;
+ cursor: default;
+ }
+ }
+
+ &:hover {
+ .c-menu-user {
+ display: block;
+ left: auto;
+ right: 0;
+ }
+ }
+
+ .c-unread-dot {
+ width: 10px;
+ height: 10px;
+ border-radius: 5px;
+ margin-left: -10px;
+ margin-top: -25px;
+ background-color: $red;
+ border: 1px solid $white !important;
+ }
+
+ .c-unread-count {
+ display: inline-block;
+ background-color: $red;
+ position: absolute;
+ right: 5px;
+ padding: 2px 8px;
+ color: $white;
+ border-radius: 100px;
+ font-size: $font-size-mini;
+ text-align: center;
+ }
+ }
}
}
diff --git a/public/components/common/Header.tsx b/public/components/common/Header.tsx
index 446cf3a76..e3eafca98 100644
--- a/public/components/common/Header.tsx
+++ b/public/components/common/Header.tsx
@@ -43,32 +43,30 @@ export class Header extends React.Component<HeaderProps, HeaderState> {
public render() {
const items = this.props.user && (
- <div className="ui vertical menu">
- <div className="name header">
+ <div className="c-menu-user">
+ <div className="c-menu-user-heading">
<i className="user icon" />
{this.props.user.name}
</div>
- <a href="/settings" className="item">
+ <a href="/settings" className="c-menu-user-item">
Settings
</a>
- <a href="/notifications" className="item">
+ <a href="/notifications" className="c-menu-user-item">
Notifications
- {this.state.unreadNotifications > 0 && (
- <div className="ui mini circular red label">{this.state.unreadNotifications}</div>
- )}
+ {this.state.unreadNotifications > 0 && <div className="c-unread-count">{this.state.unreadNotifications}</div>}
</a>
- <div className="divider" />
+ <div className="c-menu-user-divider" />
{this.props.user.isCollaborator && [
- <div key={1} className="header">
+ <div key={1} className="c-menu-user-heading">
<i className="setting icon" />
Administration
</div>,
- <a key={2} href="/admin" className="item">
+ <a key={2} href="/admin" className="c-menu-user-item">
Site Settings
</a>,
- <div key={5} className="divider" />
+ <div key={5} className="c-menu-user-divider" />
]}
- <a href="/signout?redirect=/" className="item signout">
+ <a href="/signout?redirect=/" className="c-menu-user-item signout">
Sign out
</a>
</div>
@@ -76,7 +74,7 @@ export class Header extends React.Component<HeaderProps, HeaderState> {
const showRightMenu = this.props.user || !this.props.tenant.isPrivate;
const profileMenuClassName = classSet({
- "ui right simple dropdown item signin": true,
+ "c-menu-item-signin": true,
subtitle: !this.props.user
});
@@ -84,16 +82,16 @@ export class Header extends React.Component<HeaderProps, HeaderState> {
<div id="c-header">
<EnvironmentInfo system={this.props.system} />
<SignInModal isOpen={this.state.showSignIn} />
- <div className="ui borderless menu">
- <div className="ui container">
- <a href="/" className="item title">
+ <div className="c-menu">
+ <div className="container">
+ <a href="/" className="c-menu-item-title">
<Logo size={100} tenant={this.props.tenant} />
<span>{this.props.tenant.name}</span>
</a>
{showRightMenu && (
<div onClick={this.showModal} className={profileMenuClassName}>
{this.props.user && <Gravatar user={this.props.user} />}
- {this.state.unreadNotifications > 0 && <div className="unread-dot" />}
+ {this.state.unreadNotifications > 0 && <div className="c-unread-dot" />}
{!this.props.user && "Sign in"} {this.props.user && <i className="dropdown icon" />}
{items}
</div>
diff --git a/public/components/common/Heading.scss b/public/components/common/Heading.scss
new file mode 100644
index 000000000..84ad6679b
--- /dev/null
+++ b/public/components/common/Heading.scss
@@ -0,0 +1,29 @@
+@import '~@fider/assets/styles/variables.scss';
+
+.c-heading {
+ margin-bottom: 10px;
+
+ .c-heading-content {
+ padding-left: 10px;
+ display: table-cell;
+ vertical-align: middle;
+ .c-heading-subtitle {
+ font-weight: 400;
+ margin-top: 5px;
+ color: $gray-darker;
+ font-size: $font-size;
+ }
+ }
+
+ .c-heading-icon {
+ font-size: 30px;
+ display: table-cell;
+ vertical-align: middle;
+ }
+
+ &.m-dividing {
+ box-shadow: 0px 1px 0px 0px rgba(34, 36, 38, 0.10);
+ padding-bottom: 5px;
+ margin-bottom: 10px;
+ }
+}
\ No newline at end of file
diff --git a/public/components/common/Heading.tsx b/public/components/common/Heading.tsx
new file mode 100644
index 000000000..90a3a22ca
--- /dev/null
+++ b/public/components/common/Heading.tsx
@@ -0,0 +1,38 @@
+import "./Heading.scss";
+
+import * as React from "react";
+import { classSet } from "@fider/services";
+
+interface HeadingLogo {
+ title: string;
+ dividing?: boolean;
+ level?: 1 | 2 | 3 | 4 | 5;
+ icon?: string;
+ subtitle?: string;
+}
+
+export const Heading = (props: HeadingLogo) => {
+ const level = props.level || 2;
+ const Tag = `h${level}`;
+ const className = classSet({
+ "c-heading": true,
+ "m-dividing": props.dividing || false
+ });
+
+ const iconClassName = classSet({
+ "c-heading-icon": true,
+ circular: level <= 2,
+ [props.icon!]: props.icon,
+ icon: true
+ });
+
+ return (
+ <Tag className={className}>
+ <i className={iconClassName} />
+ <div className="c-heading-content">
+ {props.title}
+ <div className="c-heading-subtitle">{props.subtitle}</div>
+ </div>
+ </Tag>
+ );
+};
diff --git a/public/components/common/List.scss b/public/components/common/List.scss
new file mode 100644
index 000000000..61b03007f
--- /dev/null
+++ b/public/components/common/List.scss
@@ -0,0 +1,57 @@
+@import '~@fider/assets/styles/variables.scss';
+
+.c-list {
+ margin-bottom: 15px;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ &.m-hover {
+ .c-list-item {
+ padding: 5px;
+ }
+ .c-list-item:hover {
+ background-color: $gray-lighter;
+ border-radius: 2px;
+ }
+ }
+
+ &.m-divided {
+ .c-list-item {
+ padding: 15px 0 0 0;
+ margin: 0 0 15px 0;
+ border-top: 1px solid $gray-lighter;
+ &:first-child {
+ border-top: none;
+ padding-top: 0;
+ }
+ &:last-child {
+ margin-bottom: 0;
+ }
+ }
+ }
+
+ .c-list-item {
+ display: list-item;
+ table-layout: fixed;
+ list-style-type: none;
+ list-style-position: outside;
+ padding: 3px 0;
+ border: none;
+
+ &.m-selectable {
+ cursor: pointer;
+ }
+
+ .showover {
+ visibility: hidden;
+ }
+
+ &:hover {
+ .showover {
+ visibility: visible;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/public/components/common/List.tsx b/public/components/common/List.tsx
new file mode 100644
index 000000000..f614c9faf
--- /dev/null
+++ b/public/components/common/List.tsx
@@ -0,0 +1,43 @@
+import "./List.scss";
+
+import * as React from "react";
+import { classSet } from "@fider/services";
+
+interface ListProps {
+ className?: string;
+ divided?: boolean;
+ hover?: boolean;
+}
+
+interface ListItemProps {
+ className?: string;
+ onClick?: () => void;
+}
+
+export const List: React.StatelessComponent<ListProps> = props => {
+ const className = classSet({
+ "c-list": true,
+ [props.className || ""]: true,
+ "m-divided": props.divided,
+ "m-hover": props.hover
+ });
+
+ return <div className={className}>{props.children}</div>;
+};
+
+export const ListItem: React.StatelessComponent<ListItemProps> = props => {
+ const className = classSet({
+ "c-list-item": true,
+ [props.className || ""]: true,
+ "m-selectable": props.onClick
+ });
+
+ if (props.onClick) {
+ return (
+ <div className={className} onClick={props.onClick}>
+ {props.children}
+ </div>
+ );
+ }
+ return <div className={className}>{props.children}</div>;
+};
diff --git a/public/components/common/Loader.scss b/public/components/common/Loader.scss
new file mode 100644
index 000000000..36a6b045c
--- /dev/null
+++ b/public/components/common/Loader.scss
@@ -0,0 +1,70 @@
+.c-loader {
+ display: block;
+ position: relative;
+ text-align: center;
+ z-index: 1000;
+ width: 30px;
+ height: 30px;
+ margin-top: 10px;
+ margin-bottom: 10px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.c-loader:before {
+ position: absolute;
+ content: '';
+ top: 0%;
+ left: 50%;
+ width: 100%;
+ height: 100%;
+ border-radius: 500rem;
+ border: 0.2em solid rgba(0, 0, 0, 0.1);
+}
+
+.c-loader:after {
+ position: absolute;
+ content: '';
+ top: 0%;
+ left: 50%;
+ width: 100%;
+ height: 100%;
+ -webkit-animation: loader 0.6s linear;
+ animation: loader 0.6s linear;
+ -webkit-animation-iteration-count: infinite;
+ animation-iteration-count: infinite;
+ border-radius: 500rem;
+ border-color: #767676 transparent transparent;
+ border-style: solid;
+ border-width: 0.2em;
+ -webkit-box-shadow: 0px 0px 0px 1px transparent;
+ box-shadow: 0px 0px 0px 1px transparent;
+}
+
+.c-loader:before,
+.c-loader:after {
+ width: 30px;
+ height: 30px;
+ margin: 0 0 0 -15px;
+}
+
+@-webkit-keyframes loader {
+ from {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ to {
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+@keyframes loader {
+ from {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ to {
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
\ No newline at end of file
diff --git a/public/components/common/Loader.tsx b/public/components/common/Loader.tsx
index 9038e72d6..d80b2d23c 100644
--- a/public/components/common/Loader.tsx
+++ b/public/components/common/Loader.tsx
@@ -1,3 +1,5 @@
+import "./Loader.scss";
+
import * as React from "react";
interface LoaderState {
@@ -28,6 +30,6 @@ export class Loader extends React.Component<{}, LoaderState> {
}
public render() {
- return this.state.show && <div className="ui active centered inline loader" />;
+ return this.state.show && <div className="c-loader" />;
}
}
diff --git a/public/components/common/Message.scss b/public/components/common/Message.scss
new file mode 100644
index 000000000..5f1ab3889
--- /dev/null
+++ b/public/components/common/Message.scss
@@ -0,0 +1,21 @@
+@import '~@fider/assets/styles/variables.scss';
+
+.c-message {
+ border-style: solid;
+ border-width: 1px;
+ font-weight: 600;
+ padding: 5px;
+ border-radius: 3px;
+
+ &.m-success {
+ color: $green-darker;
+ border-color: $green-darker;
+ background-color: rgba($green-darker, 0.08)
+ }
+
+ &.m-error {
+ color: $error;
+ border-color: $error;
+ background-color: rgba($error, 0.08)
+ }
+}
\ No newline at end of file
diff --git a/public/components/common/Message.tsx b/public/components/common/Message.tsx
new file mode 100644
index 000000000..347489851
--- /dev/null
+++ b/public/components/common/Message.tsx
@@ -0,0 +1,24 @@
+import "./Message.scss";
+
+import * as React from "react";
+import { classSet } from "@fider/services";
+
+interface MessageProps {
+ type: "success" | "error";
+}
+
+export const Message: React.StatelessComponent<MessageProps> = props => {
+ const className = classSet({
+ "c-message": true,
+ [`m-${props.type}`]: true
+ });
+
+ const icon = props.type === "error" ? "ban" : "check circle outline";
+
+ return (
+ <div className={className}>
+ <i className={`${icon} icon`} />
+ {props.children}
+ </div>
+ );
+};
diff --git a/public/components/common/Modal.scss b/public/components/common/Modal.scss
index d438f11bd..4ff48bf3f 100644
--- a/public/components/common/Modal.scss
+++ b/public/components/common/Modal.scss
@@ -1,6 +1,6 @@
@import '~@fider/assets/styles/variables.scss';
-.c-modal__dimmer {
+.c-modal-dimmer {
position: fixed;
top: 0;
left: 0;
@@ -22,7 +22,7 @@
}
}
-.c-modal__window {
+.c-modal-window {
z-index: 101;
text-align: left;
background: #fff;
@@ -32,34 +32,34 @@
box-shadow: 1px 3px 3px 0 rgba(0,0,0,.2), 1px 3px 15px 2px rgba(0,0,0,.2);
width: 100%;
- &.small {
- @include media(">tablet") {
+ &.m-small {
+ @include media(">=md") {
width: 500px;
}
}
- &.large {
- @include media(">tablet") {
+ &.m-large {
+ @include media(">=md") {
width: 750px;
}
}
- &.center {
+ &.m-center {
text-align: center;
}
- .c-modal__header {
+ .c-modal-header {
font-size: $font-size-large;
- font-weight: 700;
+ font-weight: 600;
padding: 15px 20px;
border-bottom: 1px solid $gray-lighter;
}
- .c-modal__content {
+ .c-modal-content {
padding: 15px 20px;
}
- .c-modal__footer {
+ .c-modal-footer {
background: #f9fafb;
padding: 10px;
border-top: 1px solid rgba(34,36,38,.15);
diff --git a/public/components/common/Modal.tsx b/public/components/common/Modal.tsx
index ee2a22561..fc2d6b583 100644
--- a/public/components/common/Modal.tsx
+++ b/public/components/common/Modal.tsx
@@ -83,13 +83,13 @@ class ModalWindow extends React.Component<ModalWindowProps, ModalWindowState> {
document.body.style.overflow = "hidden";
const className = classSet({
- "c-modal__window": true,
- center: this.props.center,
- [this.props.size!]: true
+ "c-modal-window": true,
+ "m-center": this.props.center,
+ [`m-${this.props.size}`]: true
});
return ReactDOM.createPortal(
- <div aria-disabled={true} className="c-modal__dimmer" onClick={this.close}>
+ <div aria-disabled={true} className="c-modal-dimmer" onClick={this.close}>
<div className={className} onClick={this.swallow}>
{this.props.children}
</div>
@@ -102,12 +102,12 @@ class ModalWindow extends React.Component<ModalWindowProps, ModalWindowState> {
export const Modal = {
Window: ModalWindow,
Header: (props: { children: React.ReactNode }) => {
- return <div className="c-modal__header">{props.children}</div>;
+ return <div className="c-modal-header">{props.children}</div>;
},
Content: (props: { children: React.ReactNode }) => {
- return <div className="c-modal__content">{props.children}</div>;
+ return <div className="c-modal-content">{props.children}</div>;
},
Footer: (props: { children: React.ReactNode }) => {
- return <div className="c-modal__footer">{props.children}</div>;
+ return <div className="c-modal-footer">{props.children}</div>;
}
};
diff --git a/public/components/common/Segment.scss b/public/components/common/Segment.scss
new file mode 100644
index 000000000..b46ac0be3
--- /dev/null
+++ b/public/components/common/Segment.scss
@@ -0,0 +1,35 @@
+.c-segment {
+ position: relative;
+ padding: 15px;
+ margin: 10px 0;
+ box-shadow: 0 1px 2px 0 rgba(34, 36, 38, 0.15);
+ border-radius: 5px;
+ border: 1px solid rgba(34, 36, 38, 0.15);
+
+ &:first-child {
+ margin-top: 0em;
+ }
+}
+
+.c-segments {
+ position: relative;
+ box-shadow: 0 1px 2px 0 rgba(34, 36, 38, 0.15);
+ border-radius: 5px;
+ margin: 10px 0;
+ border: 1px solid rgba(34, 36, 38, 0.15);
+
+ &:first-child {
+ margin-top: 0em;
+ }
+
+ .c-segment {
+ margin: 0;
+ box-shadow: none;
+ border-radius: 0px;
+ border: none;
+ border-bottom: 1px solid rgba(34, 36, 38, 0.15);
+ &:last-child {
+ border-bottom: none;
+ }
+ }
+}
\ No newline at end of file
diff --git a/public/components/common/Segment.tsx b/public/components/common/Segment.tsx
new file mode 100644
index 000000000..260c4f391
--- /dev/null
+++ b/public/components/common/Segment.tsx
@@ -0,0 +1,15 @@
+import "./Segment.scss";
+
+import * as React from "react";
+
+interface SegmentProps {
+ className?: string;
+}
+
+export const Segments: React.StatelessComponent<SegmentProps> = props => {
+ return <div className={`c-segments ${props.className || ""}`}>{props.children}</div>;
+};
+
+export const Segment: React.StatelessComponent<SegmentProps> = props => {
+ return <div className={`c-segment ${props.className || ""}`}>{props.children}</div>;
+};
diff --git a/public/components/common/SignInControl.scss b/public/components/common/SignInControl.scss
new file mode 100644
index 000000000..3bc910a6e
--- /dev/null
+++ b/public/components/common/SignInControl.scss
@@ -0,0 +1,5 @@
+.c-signin-control {
+ .l-social-col {
+ padding: 10px 5px;
+ }
+}
\ No newline at end of file
diff --git a/public/components/common/SignInControl.tsx b/public/components/common/SignInControl.tsx
index 53ef35ed8..b8f117254 100644
--- a/public/components/common/SignInControl.tsx
+++ b/public/components/common/SignInControl.tsx
@@ -1,10 +1,13 @@
+import "./SignInControl.scss";
+
import * as React from "react";
-import { SocialSignInButton, Form, Button } from "@fider/components/common";
+import { SocialSignInButton, Form, Button, Input } from "@fider/components";
import { AuthSettings } from "@fider/models";
-import { page, device, actions } from "@fider/services";
+import { page, device, actions, Failure } from "@fider/services";
interface SignInControlState {
email: string;
+ error?: Failure;
}
interface SignInControlProps {
@@ -14,7 +17,6 @@ interface SignInControlProps {
}
export class SignInControl extends React.Component<SignInControlProps, SignInControlState> {
- private form!: Form;
private settings: AuthSettings;
constructor(props: SignInControlProps) {
@@ -34,22 +36,21 @@ export class SignInControl extends React.Component<SignInControlProps, SignInCon
}
};
- private async signIn() {
+ private signIn = async () => {
const result = await actions.signIn(this.state.email);
if (result.ok) {
- this.form.clearFailure();
if (this.props.onEmailSent) {
this.props.onEmailSent(this.state.email);
}
- this.setState({ email: "" });
+ this.setState({ email: "", error: undefined });
} else if (result.error) {
- this.form.setFailure(result.error);
+ this.setState({ error: result.error });
}
- }
+ };
public render() {
const google = this.settings.providers.google && (
- <div className="column">
+ <div className="col-md-4 l-social-col">
<SocialSignInButton
oauthEndpoint={this.settings.endpoint}
provider="google"
@@ -58,7 +59,7 @@ export class SignInControl extends React.Component<SignInControlProps, SignInCon
</div>
);
const facebook = this.settings.providers.facebook && (
- <div className="column">
+ <div className="col-md-4 l-social-col">
<SocialSignInButton
oauthEndpoint={this.settings.endpoint}
provider="facebook"
@@ -67,7 +68,7 @@ export class SignInControl extends React.Component<SignInControlProps, SignInCon
</div>
);
const github = this.settings.providers.github && (
- <div className="column">
+ <div className="col-md-4 l-social-col">
<SocialSignInButton
oauthEndpoint={this.settings.endpoint}
provider="github"
@@ -78,41 +79,36 @@ export class SignInControl extends React.Component<SignInControlProps, SignInCon
const hasOAuth = !!(google || facebook || github);
return (
- <div className="signin-options">
+ <div className="c-signin-control">
{hasOAuth && (
<div>
- <div className="ui stackable three column centered grid">
+ <div className="row">
{facebook}
{google}
{github}
</div>
<p className="info">We'll never post to any of your accounts</p>
- <div className="ui horizontal divider">OR</div>
+ <div className="c-divider">OR</div>
</div>
)}
{this.props.useEmail && (
<div>
<p>Enter your email address to sign in</p>
- <Form
- ref={f => {
- this.form = f!;
- }}
- >
- <div id="email-signin" className="ui small action fluid input">
- <input
- value={this.state.email}
- autoFocus={!device.isTouch()}
- onChange={e => this.setState({ email: e.currentTarget.value })}
- onKeyDown={this.onEmailKeyDown}
- type="text"
- placeholder="[email protected]"
- className="small"
- />
- <Button color="positive" disabled={this.state.email === ""} onClick={() => this.signIn()}>
- Sign in
- </Button>
- </div>
+ <Form error={this.state.error}>
+ <Input
+ field="email"
+ value={this.state.email}
+ autoFocus={!device.isTouch()}
+ onChange={email => this.setState({ email })}
+ onSubmit={this.signIn}
+ placeholder="[email protected]"
+ suffix={
+ <Button color="positive" disabled={this.state.email === ""} onClick={this.signIn}>
+ Sign in
+ </Button>
+ }
+ />
</Form>
</div>
)}
diff --git a/public/components/common/SocialSignInButton.tsx b/public/components/common/SocialSignInButton.tsx
index 26c9083d8..54f7d4238 100644
--- a/public/components/common/SocialSignInButton.tsx
+++ b/public/components/common/SocialSignInButton.tsx
@@ -2,30 +2,32 @@ import * as React from "react";
import { Button } from "@fider/components/common";
interface SocialSignInButtonProps {
- oauthEndpoint: string;
provider: "google" | "facebook" | "github";
+ oauthEndpoint?: string;
redirectTo?: string;
}
const providers = {
google: {
name: "Google",
- class: "social google"
+ class: "m-social m-google"
},
facebook: {
name: "Facebook",
- class: "social facebook"
+ class: "m-social m-facebook"
},
github: {
name: "GitHub",
- class: "social github"
+ class: "m-social m-github"
}
};
export class SocialSignInButton extends React.Component<SocialSignInButtonProps, {}> {
public render() {
const redirectTo = this.props.redirectTo || location.href;
- const href = `${this.props.oauthEndpoint}/oauth/${this.props.provider}?redirect=${redirectTo}`;
+ const href = this.props.oauthEndpoint
+ ? `${this.props.oauthEndpoint}/oauth/${this.props.provider}?redirect=${redirectTo}`
+ : undefined;
return (
<Button href={href} fluid={true} className={providers[this.props.provider].class}>
diff --git a/public/components/common/Toggle.scss b/public/components/common/Toggle.scss
index bf97a4caf..c971172b3 100644
--- a/public/components/common/Toggle.scss
+++ b/public/components/common/Toggle.scss
@@ -3,7 +3,7 @@
.c-toggle {
cursor: pointer;
- &.disabled {
+ &.m-disabled {
cursor: not-allowed;
label {
cursor: not-allowed;
@@ -27,7 +27,7 @@
border-radius: 0.5em;
position: relative;
cursor: pointer;
- background: $gray-darker;
+ background: $gray;
}
.switch {
diff --git a/public/components/common/Toggle.tsx b/public/components/common/Toggle.tsx
index 84c8dd096..d6534ea73 100644
--- a/public/components/common/Toggle.tsx
+++ b/public/components/common/Toggle.tsx
@@ -1,3 +1,5 @@
+import "./Toggle.scss";
+
import * as React from "react";
import { classSet } from "@fider/services";
@@ -5,15 +7,13 @@ interface ToggleProps {
label?: string;
active: boolean;
disabled?: boolean;
- onToggle: (active: boolean) => Promise<any>;
+ onToggle?: (active: boolean) => Promise<any>;
}
interface ToggleState {
active: boolean;
}
-import "./Toggle.scss";
-
export class Toggle extends React.Component<ToggleProps, ToggleState> {
public constructor(props: ToggleProps) {
super(props);
@@ -32,7 +32,9 @@ export class Toggle extends React.Component<ToggleProps, ToggleState> {
active: !state.active
}),
() => {
- this.props.onToggle(this.state.active);
+ if (this.props.onToggle) {
+ this.props.onToggle(this.state.active);
+ }
}
);
};
@@ -40,7 +42,7 @@ export class Toggle extends React.Component<ToggleProps, ToggleState> {
public render() {
const className = classSet({
"c-toggle": true,
- disabled: !!this.props.disabled
+ "m-disabled": !!this.props.disabled
});
return (
diff --git a/public/components/common/UserName.scss b/public/components/common/UserName.scss
index f7916206c..5703521e0 100644
--- a/public/components/common/UserName.scss
+++ b/public/components/common/UserName.scss
@@ -3,4 +3,10 @@
.c-username {
color: #4f5e6b;
font-weight: 500;
+
+ &.m-staff {
+ font-weight: 600;
+ color: $admin-color;
+ border-color: $admin-color;
+ }
}
\ No newline at end of file
diff --git a/public/components/common/UserName.tsx b/public/components/common/UserName.tsx
index 4e0436e26..7c6690dae 100644
--- a/public/components/common/UserName.tsx
+++ b/public/components/common/UserName.tsx
@@ -13,7 +13,7 @@ export const UserName = (props: UserNameProps) => {
const className = classSet({
"c-username": true,
- "gm-staff": isCollaborator
+ "m-staff": isCollaborator
});
return <span className={className}>{props.user.name}</span>;
diff --git a/public/components/common/DisplayError.tsx b/public/components/common/form/DisplayError.tsx
similarity index 74%
rename from public/components/common/DisplayError.tsx
rename to public/components/common/form/DisplayError.tsx
index 395b5c43c..a3518a78c 100644
--- a/public/components/common/DisplayError.tsx
+++ b/public/components/common/form/DisplayError.tsx
@@ -6,23 +6,27 @@ const arrayToTag = (items: string[]) => {
};
interface DisplayErrorProps {
- pointing?: "above" | "below";
error?: Failure;
fields?: string[];
}
+export const hasError = (field: string, error?: Failure): boolean => {
+ if (error && error.failures) {
+ return error.failures.hasOwnProperty(field);
+ }
+ return false;
+};
+
export const DisplayError = (props: DisplayErrorProps) => {
if (!props.error) {
return null;
}
- const pointing = props.pointing || "below";
-
let items: JSX.Element[] = [];
if (props.error.messages && !props.fields) {
items = arrayToTag(props.error.messages);
- } else if (props.error.failures) {
+ } else if (props.error.failures && props.fields) {
for (const field of props.fields || Object.keys(props.error.failures)) {
if (props.error.failures.hasOwnProperty(field)) {
const tags = arrayToTag(props.error.failures[field]);
@@ -32,7 +36,7 @@ export const DisplayError = (props: DisplayErrorProps) => {
}
return items.length > 0 ? (
- <div className={`display-error ui pointing ${pointing} red basic label`}>
+ <div className={`c-form-field-error`}>
<ul>{items}</ul>
</div>
) : null;
diff --git a/public/components/common/form/Field.tsx b/public/components/common/form/Field.tsx
new file mode 100644
index 000000000..7b22a495d
--- /dev/null
+++ b/public/components/common/form/Field.tsx
@@ -0,0 +1,21 @@
+import * as React from "react";
+import { classSet } from "@fider/services";
+
+interface FieldProps {
+ className?: string;
+ label?: string;
+}
+
+export const Field: React.StatelessComponent<FieldProps> = props => {
+ return (
+ <div
+ className={classSet({
+ "c-form-field": true,
+ [props.className!]: props.className
+ })}
+ >
+ {!!props.label && <label>{props.label}</label>}
+ {props.children}
+ </div>
+ );
+};
diff --git a/public/components/common/form/Form.scss b/public/components/common/form/Form.scss
new file mode 100644
index 000000000..1f7e02f9f
--- /dev/null
+++ b/public/components/common/form/Form.scss
@@ -0,0 +1,162 @@
+@import '~@fider/assets/styles/variables.scss';
+
+.c-form {
+ position: relative;
+ max-width: 100%;
+
+ &.m-mini {
+ font-size: 80%;
+ input[type=text],
+ textarea,
+ select {
+ padding: 8px;
+ }
+ }
+}
+
+.c-form-field {
+ clear: both;
+ margin: 0 0 10px;
+
+ label {
+ display: block;
+ margin: 0 0 5px;
+ font-weight: 600;
+
+ .info {
+ padding: 5px 0px 0px 5px;
+ }
+ .info.clickable {
+ color: $link-color;
+ }
+ }
+
+ .c-form-field-wrapper {
+ position: relative;
+ margin: 0 0 5px;
+
+ input[type=text],
+ textarea,
+ select {
+ width: 100%;
+ padding: 10px;
+ outline: 0;
+ margin: 0;
+ resize: none !important;
+ border: 1px solid $gray-light;
+ border-radius: 3px;
+
+ &:focus {
+ border: 1px solid $focus-color;
+ }
+
+ &:disabled {
+ opacity: .45;
+ cursor: not-allowed;
+ }
+ & + .icon {
+ pointer-events: none;
+ cursor: default;
+ position: absolute;
+ opacity: .5;
+ width: 35px;
+ height: 100%;
+ margin: 0;
+ top: 0;
+ right: 0;
+ &::before {
+ top: 10px;
+ right: 12px;
+ position: absolute;
+ }
+
+ &.link {
+ cursor: pointer;
+ pointer-events: inherit;
+ }
+ }
+ }
+
+ select {
+ height: 38px;
+ background-color: $white;
+ }
+ }
+
+ &.m-error {
+ input[type=text],
+ textarea,
+ select {
+ background-color: rgba($error, .05);
+ border-color: $error;
+ }
+ }
+
+ &.m-icon {
+ input[type=text] {
+ padding-right: 35px;
+ }
+ }
+
+ &.m-suffix {
+ .c-form-field-wrapper {
+ display: inline-flex;
+ width: 100%;
+ }
+ .c-button {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+ }
+ input[type=text] {
+ max-width: 100%;
+ width: auto;
+ flex: 1 0 auto;
+ border-top-right-radius: 0px;
+ border-bottom-right-radius: 0px;
+ }
+ .c-form-input-suffix {
+ line-height: 20px;
+ flex: 0 0 auto;
+ padding: 8px 10px 9px 10px;;
+ font-weight: 600;
+ background-color: $gray-lighter;
+ border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
+ }
+ }
+
+ .c-form-radio-option {
+ label {
+ display: inline-block;
+ margin-left: 5px;
+ font-size: $font-size-small;
+ font-weight: 500;
+ cursor: pointer;
+ }
+ }
+}
+
+.c-form-field-error {
+ color: $error;
+ font-weight: bold;
+ font-size: $font-size-small;
+ margin: 0 0 10px 0;
+ ul {
+ list-style: none;
+ padding-left: 5px;
+ margin: 0;
+ }
+}
+
+::placeholder {
+ color: $gray;
+ opacity: 1;
+}
+
+:-ms-input-placeholder {
+ color: $gray;
+}
+
+::-ms-input-placeholder {
+ color: $gray;
+}
\ No newline at end of file
diff --git a/public/components/common/form/Form.tsx b/public/components/common/form/Form.tsx
new file mode 100644
index 000000000..9e8637865
--- /dev/null
+++ b/public/components/common/form/Form.tsx
@@ -0,0 +1,42 @@
+import "./Form.scss";
+
+import * as React from "react";
+import { Failure, classSet } from "@fider/services";
+import { Button, DisplayError } from "@fider/components";
+
+interface ValidationContext {
+ error?: Failure;
+}
+
+interface FormProps {
+ className?: string;
+ size?: "mini" | "normal";
+ error?: Failure;
+}
+
+export const ValidationContext = React.createContext<ValidationContext>({});
+
+export class Form extends React.Component<FormProps, {}> {
+ constructor(props: FormProps) {
+ super(props);
+ this.state = {
+ error: this.props.error
+ };
+ }
+
+ public render() {
+ const className = classSet({
+ "c-form": true,
+ [this.props.className!]: this.props.className,
+ [`m-${this.props.size}`]: this.props.size
+ });
+ return (
+ <form autoComplete="off" className={className}>
+ <DisplayError error={this.props.error} />
+ <ValidationContext.Provider value={{ error: this.props.error }}>
+ {this.props.children}
+ </ValidationContext.Provider>
+ </form>
+ );
+ }
+}
diff --git a/public/components/common/form/Input.tsx b/public/components/common/form/Input.tsx
new file mode 100644
index 000000000..6f2956dfa
--- /dev/null
+++ b/public/components/common/form/Input.tsx
@@ -0,0 +1,101 @@
+import * as React from "react";
+import { Failure, classSet } from "@fider/services";
+import { ValidationContext } from "./Form";
+import { DisplayError, hasError } from "./DisplayError";
+import { Button } from "@fider/components";
+
+interface InputProps {
+ field: string;
+ label?: string;
+ autoFocus?: boolean;
+ afterLabel?: JSX.Element;
+ icon?: string;
+ maxLength?: number;
+ value?: string;
+ disabled?: boolean;
+ suffix?: string | JSX.Element;
+ placeholder?: string;
+ onIconClick?: () => void;
+ onSubmit?: () => void;
+ onFocus?: () => void;
+ inputRef?: (node: HTMLInputElement) => void;
+ onChange?: (value: string) => void;
+}
+
+export class Input extends React.Component<InputProps, {}> {
+ constructor(props: InputProps) {
+ super(props);
+ }
+
+ private onChange = (e: React.FormEvent<HTMLInputElement>) => {
+ if (this.props.onChange) {
+ this.props.onChange(e.currentTarget.value);
+ }
+ };
+
+ private onKeyDown = (event: React.KeyboardEvent<HTMLInputElement>): void => {
+ if (event.keyCode === 13 && this.props.onSubmit) {
+ this.props.onSubmit();
+ event.preventDefault();
+ }
+ };
+
+ public render() {
+ const suffix =
+ typeof this.props.suffix === "string" ? (
+ <span className="c-form-input-suffix">{this.props.suffix}</span>
+ ) : (
+ this.props.suffix
+ );
+
+ return (
+ <ValidationContext.Consumer>
+ {ctx => (
+ <div
+ className={classSet({
+ "c-form-field": true,
+ "m-suffix": this.props.suffix,
+ "m-error": hasError(this.props.field, ctx.error),
+ "m-icon": this.props.icon
+ })}
+ >
+ {!!this.props.label && (
+ <label htmlFor={`input-${this.props.field}`}>
+ {this.props.label}
+ {this.props.afterLabel}
+ </label>
+ )}
+ <div className="c-form-field-wrapper">
+ <input
+ id={`input-${this.props.field}`}
+ type="text"
+ ref={this.props.inputRef}
+ autoFocus={this.props.autoFocus}
+ onFocus={this.props.onFocus}
+ maxLength={this.props.maxLength}
+ disabled={this.props.disabled}
+ value={this.props.value}
+ placeholder={this.props.placeholder}
+ onKeyDown={this.props.onSubmit ? this.onKeyDown : undefined}
+ onChange={this.onChange}
+ />
+ {!!this.props.icon && (
+ <i
+ onClick={this.props.onIconClick}
+ className={classSet({
+ icon: true,
+ [this.props.icon]: true,
+ link: this.props.onIconClick
+ })}
+ />
+ )}
+ {suffix}
+ </div>
+ <DisplayError fields={[this.props.field]} error={ctx.error} />
+ {this.props.children}
+ </div>
+ )}
+ </ValidationContext.Consumer>
+ );
+ }
+}
diff --git a/public/components/common/form/RadioButton.tsx b/public/components/common/form/RadioButton.tsx
new file mode 100644
index 000000000..6d5865476
--- /dev/null
+++ b/public/components/common/form/RadioButton.tsx
@@ -0,0 +1,61 @@
+import * as React from "react";
+import { Failure, classSet } from "@fider/services";
+import { DisplayError } from "../";
+
+interface RadioButtonOption {
+ value: string;
+ label: string;
+}
+
+interface RadioButtonProps {
+ label: string;
+ field: string;
+ defaultOption: RadioButtonOption;
+ options: RadioButtonOption[];
+ onSelect?: (value: RadioButtonOption) => void;
+}
+
+interface RadioButtonState {
+ selected: RadioButtonOption;
+}
+
+export class RadioButton extends React.Component<RadioButtonProps, RadioButtonState> {
+ constructor(props: RadioButtonProps) {
+ super(props);
+ this.state = {
+ selected: props.defaultOption || props.options[0]
+ };
+ }
+
+ private onChange = (selected: RadioButtonOption) => {
+ this.setState({ selected }, () => {
+ if (this.props.onSelect) {
+ this.props.onSelect(this.state.selected);
+ }
+ });
+ };
+
+ public render() {
+ const inputs = this.props.options.map(option => {
+ return (
+ <div key={option.value} className="c-form-radio-option">
+ <input
+ id={`visibility-${option.value}`}
+ type="radio"
+ name={`input-${this.props.field}`}
+ checked={this.state.selected === option}
+ onChange={this.onChange.bind(this, option)}
+ />
+ <label htmlFor={`visibility-${option.value}`}>{option.label}</label>
+ </div>
+ );
+ });
+
+ return (
+ <div className="c-form-field">
+ <label htmlFor={`input-${this.props.field}`}>{this.props.label}</label>
+ {inputs}
+ </div>
+ );
+ }
+}
diff --git a/public/components/common/form/Select.tsx b/public/components/common/form/Select.tsx
new file mode 100644
index 000000000..e9621e5b5
--- /dev/null
+++ b/public/components/common/form/Select.tsx
@@ -0,0 +1,94 @@
+import * as React from "react";
+import { Failure, classSet } from "@fider/services";
+import { ValidationContext } from "./Form";
+import { DisplayError, hasError } from "./DisplayError";
+
+export interface SelectOption {
+ value: string;
+ label: string;
+}
+
+interface SelectProps {
+ field: string;
+ label?: string;
+ maxLength?: number;
+ defaultValue?: string;
+ options: SelectOption[];
+ onChange?: (option?: SelectOption) => void;
+}
+
+interface SelectState {
+ selected?: SelectOption;
+}
+
+export class Select extends React.Component<SelectProps, SelectState> {
+ constructor(props: SelectProps) {
+ super(props);
+ this.state = {
+ selected: this.getOption(props.defaultValue)
+ };
+ }
+
+ private getOption(value?: string): SelectOption | undefined {
+ if (value && this.props.options) {
+ const filtered = this.props.options.filter(x => x.value === value);
+ if (filtered && filtered.length > 0) {
+ return filtered[0];
+ }
+ }
+ }
+
+ private onChange = (e: React.FormEvent<HTMLSelectElement>) => {
+ let selected: SelectOption | undefined;
+ if (e.currentTarget.value) {
+ const options = this.props.options.filter(o => o.value === e.currentTarget.value);
+ if (options && options.length > 0) {
+ selected = options[0];
+ }
+ }
+
+ this.setState({ selected }, () => {
+ if (this.props.onChange) {
+ this.props.onChange(this.state.selected);
+ }
+ });
+ };
+
+ public render() {
+ const options = this.props.options.map(option => {
+ return (
+ <option key={option.value} value={option.value}>
+ {option.label}
+ </option>
+ );
+ });
+
+ return (
+ <ValidationContext.Consumer>
+ {ctx => (
+ <>
+ <div
+ className={classSet({
+ "c-form-field": true,
+ "m-error": hasError(this.props.field, ctx.error)
+ })}
+ >
+ {!!this.props.label && <label htmlFor={`input-${this.props.field}`}>{this.props.label}</label>}
+ <div className="c-form-field-wrapper">
+ <select
+ id={`input-${this.props.field}`}
+ defaultValue={this.props.defaultValue}
+ onChange={this.onChange}
+ >
+ {options}
+ </select>
+ </div>
+ <DisplayError fields={[this.props.field]} error={ctx.error} />
+ {this.props.children}
+ </div>
+ </>
+ )}
+ </ValidationContext.Consumer>
+ );
+ }
+}
diff --git a/public/components/common/form/TextArea.tsx b/public/components/common/form/TextArea.tsx
new file mode 100644
index 000000000..c5e0e2cdf
--- /dev/null
+++ b/public/components/common/form/TextArea.tsx
@@ -0,0 +1,62 @@
+import * as React from "react";
+import { Failure, classSet } from "@fider/services";
+import { ValidationContext } from "../";
+import { DisplayError, hasError } from "./DisplayError";
+import Textarea from "react-textarea-autosize";
+
+interface TextAreaProps {
+ label?: string;
+ field: string;
+ value?: string;
+ disabled?: boolean;
+ minRows?: number;
+ placeholder?: string;
+ onChange?: (value: string) => void;
+ inputRef?: (node: HTMLTextAreaElement) => void;
+ onFocus?: React.FocusEventHandler<HTMLTextAreaElement>;
+}
+
+export class TextArea extends React.Component<TextAreaProps, {}> {
+ constructor(props: TextAreaProps) {
+ super(props);
+ }
+
+ private onChange = (e: React.FormEvent<HTMLTextAreaElement>) => {
+ if (this.props.onChange) {
+ this.props.onChange(e.currentTarget.value);
+ }
+ };
+
+ public render() {
+ return (
+ <ValidationContext.Consumer>
+ {ctx => (
+ <>
+ <div
+ className={classSet({
+ "c-form-field": true,
+ "m-error": hasError(this.props.field, ctx.error)
+ })}
+ >
+ {!!this.props.label && <label htmlFor={`input-${this.props.field}`}>{this.props.label}</label>}
+ <div className="c-form-field-wrapper">
+ <Textarea
+ id={`input-${this.props.field}`}
+ disabled={this.props.disabled}
+ onChange={this.onChange}
+ value={this.props.value}
+ minRows={this.props.minRows || 3}
+ placeholder={this.props.placeholder}
+ inputRef={this.props.inputRef}
+ onFocus={this.props.onFocus}
+ />
+ </div>
+ <DisplayError fields={[this.props.field]} error={ctx.error} />
+ {this.props.children}
+ </div>
+ </>
+ )}
+ </ValidationContext.Consumer>
+ );
+ }
+}
diff --git a/public/components/common/index.tsx b/public/components/common/index.tsx
index ccc884461..4f1359500 100644
--- a/public/components/common/index.tsx
+++ b/public/components/common/index.tsx
@@ -1,16 +1,25 @@
export * from "./Button";
-export * from "./Form";
+export * from "./form/Form";
+export * from "./form/Input";
+export * from "./form/TextArea";
+export * from "./form/RadioButton";
+export * from "./form/DisplayError";
+export * from "./form/Select";
+export * from "./form/Field";
export * from "./MultiLineText";
-export * from "./DisplayError";
export * from "./EnvironmentInfo";
export * from "./Gravatar";
+export * from "./Message";
export * from "./Footer";
export * from "./Header";
+export * from "./Heading";
export * from "./SocialSignInButton";
export * from "./SignInControl";
+export * from "./Segment";
+export * from "./List";
export * from "./Moment";
-export * from "./UserName";
export * from "./Modal";
+export * from "./UserName";
export * from "./Loader";
export * from "./Logo";
export * from "./Toggle";
diff --git a/public/index.tsx b/public/index.tsx
index 1805ecb23..5f257a1e5 100644
--- a/public/index.tsx
+++ b/public/index.tsx
@@ -2,37 +2,20 @@ import * as React from "react";
import * as ReactDOM from "react-dom";
import { resolveRootComponent } from "@fider/router";
import { Header, Footer } from "@fider/components/common";
-import { analytics } from "@fider/services";
+import { analytics, classSet } from "@fider/services";
import { ToastContainer } from "react-toastify";
import "semantic-ui-css/components/reset.min.css";
-import "semantic-ui-css/components/site.min.css";
-import "semantic-ui-css/components/segment.min.css";
-import "semantic-ui-css/components/loader.min.css";
-import "semantic-ui-css/components/table.min.css";
-import "semantic-ui-css/components/checkbox.min.css";
-import "semantic-ui-css/components/transition.min.css";
-import "semantic-ui-css/components/header.min.css";
-import "semantic-ui-css/components/form.min.css";
-import "semantic-ui-css/components/container.min.css";
-import "semantic-ui-css/components/dropdown.min.css";
-import "semantic-ui-css/components/input.min.css";
-import "semantic-ui-css/components/label.min.css";
-import "semantic-ui-css/components/list.min.css";
-import "semantic-ui-css/components/divider.min.css";
-import "semantic-ui-css/components/item.min.css";
-import "semantic-ui-css/components/grid.min.css";
import "semantic-ui-css/components/icon.min.css";
-import "semantic-ui-css/components/message.min.css";
-import "semantic-ui-css/components/menu.min.css";
-import "semantic-ui-css/components/comment.min.css";
+import "semantic-ui-css/components/dropdown.min.css";
+import "semantic-ui-css/components/transition.min.css";
+
import "react-toastify/dist/ReactToastify.css";
import "@fider/assets/styles/main.scss";
-const w = window as any;
-w.props = {};
-w.set = (key: string, value: any): void => {
- w.props[key] = value;
+window.props = {} as any;
+window.set = (key: string, value: any): void => {
+ window.props[key] = value;
};
window.addEventListener("error", (evt: ErrorEvent) => {
@@ -43,12 +26,16 @@ document.addEventListener("DOMContentLoaded", () => {
const root = document.getElementById("root");
if (root) {
const config = resolveRootComponent(location.pathname);
+ document.body.className = classSet({
+ "is-authenticated": window.props.user,
+ "is-staff": window.props.user && window.props.user.isCollaborator
+ });
ReactDOM.render(
<>
<ToastContainer position="top-right" toastClassName="c-toast" />
- {config.showHeader && React.createElement(Header, w.props)}
- {React.createElement(config.component, w.props)}
- {config.showHeader && React.createElement(Footer, w.props)}
+ {config.showHeader && React.createElement(Header, window.props)}
+ {React.createElement(config.component, window.props)}
+ {config.showHeader && React.createElement(Footer, window.props)}
</>,
root
);
diff --git a/public/pages/Administration/components/AdminBasePage.tsx b/public/pages/Administration/components/AdminBasePage.tsx
index 562e4b029..ed2d5835f 100644
--- a/public/pages/Administration/components/AdminBasePage.tsx
+++ b/public/pages/Administration/components/AdminBasePage.tsx
@@ -1,5 +1,6 @@
import * as React from "react";
import { CurrentUser } from "@fider/models";
+import { Heading } from "@fider/components";
import { SideMenu } from "./";
interface AdminBasePageProps {
@@ -16,20 +17,14 @@ export abstract class AdminBasePage<P extends AdminBasePageProps, S> extends Rea
public render() {
return (
- <div id={this.id} className="page ui container">
- <h2 className="ui header">
- <i className={`circular ${this.icon} icon`} />
- <div className="content">
- {this.title}
- <div className="sub header">{this.subtitle}</div>
- </div>
- </h2>
+ <div id={this.id} className="page container">
+ <Heading title={this.title} icon={this.icon} subtitle={this.subtitle} />
- <div className="ui grid">
- <div className="three wide computer sixteen wide mobile column">
+ <div className="row">
+ <div className="col-lg-2">
<SideMenu user={this.props.user} activeItem={this.name} />
</div>
- <div className="thirteen wide computer sixteen wide mobile column">{this.content()}</div>
+ <div className="col-lg-10">{this.content()}</div>
</div>
</div>
);
diff --git a/public/pages/Administration/components/SideMenu.scss b/public/pages/Administration/components/SideMenu.scss
new file mode 100644
index 000000000..d1039f1f4
--- /dev/null
+++ b/public/pages/Administration/components/SideMenu.scss
@@ -0,0 +1,32 @@
+@import '~@fider/assets/styles/variables.scss';
+
+.c-side-menu {
+ display: block;
+ border: 1px solid rgba(34, 36, 38, .1);
+ box-shadow: 0 1px 2px 0 rgba(34, 36, 38, .1);
+ border-radius: 5px;
+ background-color: $white;
+ margin-bottom: 15px;
+
+ .c-side-menu-item {
+ display: block;
+ padding: 12px;
+ border-bottom: 1px solid rgba(34, 36, 38, .1);
+ color: $text-color;
+
+ &:hover {
+ color: $text-color;
+ background-color: $gray-lightest;
+ }
+
+ &.m-active {
+ color: $admin-color;
+ border-left: 2px solid $admin-color;
+ font-weight: 600;
+ background-color: $menu-color;
+ &:hover {
+ color: $admin-color;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/public/pages/Administration/components/SideMenu.tsx b/public/pages/Administration/components/SideMenu.tsx
index 31ac49e14..5980f73c1 100644
--- a/public/pages/Administration/components/SideMenu.tsx
+++ b/public/pages/Administration/components/SideMenu.tsx
@@ -1,3 +1,5 @@
+import "./SideMenu.scss";
+
import * as React from "react";
import { CurrentUser } from "@fider/models";
import { classSet, page } from "@fider/services";
@@ -17,8 +19,8 @@ interface SideMenuItemProps {
const SideMenuItem = (props: SideMenuItemProps) => {
const className = classSet({
- item: true,
- active: props.isActive
+ "c-side-menu-item": true,
+ "m-active": props.isActive
});
if (props.isActive) {
@@ -40,7 +42,7 @@ export const SideMenu = (props: SiteMenuProps) => {
const activeItem = props.activeItem || "general";
return (
<>
- <div className="ui vertical menu fluid">
+ <div className="c-side-menu">
<SideMenuItem name="general" title="General" href="/admin" isActive={activeItem === "general"} />
<SideMenuItem name="privacy" title="Privacy" href="/admin/privacy" isActive={activeItem === "privacy"} />
<SideMenuItem name="members" title="Members" href="/admin/members" isActive={activeItem === "members"} />
@@ -51,6 +53,7 @@ export const SideMenu = (props: SiteMenuProps) => {
href="/admin/invitations"
isActive={activeItem === "invitations"}
/>
+ <SideMenuItem name="advanced" title="Advanced" href="/admin/advanced" isActive={activeItem === "advanced"} />
{props.user.isAdministrator && (
<SideMenuItem name="export" title="Export" href="/admin/export" isActive={activeItem === "export"} />
)}
diff --git a/public/pages/Administration/components/TagForm.tsx b/public/pages/Administration/components/TagForm.tsx
index 3a7a2dfc2..527c73b50 100644
--- a/public/pages/Administration/components/TagForm.tsx
+++ b/public/pages/Administration/components/TagForm.tsx
@@ -1,8 +1,7 @@
import "./TagForm.scss";
import * as React from "react";
-import { Button, ButtonClickEvent, DisplayError } from "@fider/components/common";
-import { ShowTag } from "@fider/components/ShowTag";
+import { Button, Input, ButtonClickEvent, ShowTag, DisplayError, Form, RadioButton, Field } from "@fider/components";
import { Tag } from "@fider/models";
import { Failure } from "@fider/services";
@@ -22,6 +21,9 @@ export interface TagFormState {
}
export class TagForm extends React.Component<TagFormProps, TagFormState> {
+ private visibilityPublic = { label: "Public", value: "public" };
+ private visibilityPrivate = { label: "Private", value: "private" };
+
constructor(props: TagFormProps) {
super(props);
this.state = {
@@ -48,82 +50,55 @@ export class TagForm extends React.Component<TagFormProps, TagFormState> {
}
public render() {
+ const randomizer = (
+ <span className="info clickable" onClick={() => this.setState({ color: this.randomizeColor() })}>
+ randomize
+ </span>
+ );
+
return (
- <div id="tag-form" className="ui form">
- <div className="four fields">
- <div className="four wide field">
- <label>Name</label>
- <input
- className="name"
- onChange={e => this.setState({ name: e.currentTarget.value })}
- type="text"
- placeholder="New tag name"
- value={this.state.name}
- />
- <DisplayError fields={["name"]} error={this.state.error} pointing="above" />
+ <Form error={this.state.error}>
+ <div className="row">
+ <div className="col-lg-3">
+ <Input field="name" label="Name" value={this.state.name} onChange={name => this.setState({ name })} />
</div>
- <div className="three wide field">
- <label>
- Color
- <span className="info clickable" onClick={() => this.setState({ color: this.randomizeColor() })}>
- randomize
- </span>
- </label>
- <input
- className="color"
- onChange={e => this.setState({ color: e.currentTarget.value })}
- type="text"
+ <div className="col-lg-2">
+ <Input
+ field="color"
+ label="Color"
+ afterLabel={randomizer}
value={this.state.color}
+ onChange={color => this.setState({ color })}
/>
- <DisplayError fields={["color"]} error={this.state.error} pointing="above" />
</div>
- <div className="two wide field">
- <div className="grouped fields">
- <label>Visibility</label>
- <div className="field">
- <div className="ui radio checkbox">
- <input
- id="visibility-public"
- type="radio"
- name="visibility"
- checked={this.state.isPublic}
- onChange={e => this.setState({ isPublic: true })}
- />
- <label htmlFor="visibility-public">Public</label>
- </div>
- </div>
- <div className="field">
- <div className="ui radio checkbox">
- <input
- id="visibility-private"
- type="radio"
- name="visibility"
- checked={!this.state.isPublic}
- onChange={e => this.setState({ isPublic: false })}
- />
- <label htmlFor="visibility-private">Private</label>
- </div>
- </div>
- </div>
- </div>
- <div className="field">
- <label>Preview</label>
- <ShowTag
- tag={{
- id: 0,
- slug: "",
- name: this.state.name,
- color: this.state.color,
- isPublic: this.state.isPublic
- }}
+ <div className="col-lg-2">
+ <RadioButton
+ label="Visibility"
+ field="visibility"
+ defaultOption={this.state.isPublic ? this.visibilityPublic : this.visibilityPrivate}
+ options={[this.visibilityPublic, this.visibilityPrivate]}
+ onSelect={opt => this.setState({ isPublic: opt === this.visibilityPublic })}
/>
</div>
+ <div className="col-lg-5">
+ <Field label="Preview">
+ <ShowTag
+ tag={{
+ id: 0,
+ slug: "",
+ name: this.state.name,
+ color: this.state.color,
+ isPublic: this.state.isPublic
+ }}
+ />
+ </Field>
+ </div>
</div>
- <Button onClick={async () => this.props.onCancel()}>Cancel</Button>
<Button color="positive" onClick={e => this.onSave(e)}>
Save
</Button>
- </div>
+ <Button onClick={async () => this.props.onCancel()}>Cancel</Button>
+ </Form>
);
}
}
diff --git a/public/pages/Administration/index.ts b/public/pages/Administration/index.ts
index dd16fc699..5e6ea40e4 100644
--- a/public/pages/Administration/index.ts
+++ b/public/pages/Administration/index.ts
@@ -1,4 +1,5 @@
export * from "./pages/GeneralSettings.page";
+export * from "./pages/AdvancedSettings.page";
export * from "./pages/PrivacySettings.page";
export * from "./pages/ManageTags.page";
export * from "./pages/Export.page";
diff --git a/public/pages/Administration/pages/AdvancedSettings.page.scss b/public/pages/Administration/pages/AdvancedSettings.page.scss
new file mode 100644
index 000000000..4918cd6a6
--- /dev/null
+++ b/public/pages/Administration/pages/AdvancedSettings.page.scss
@@ -0,0 +1,13 @@
+@import '~@fider/assets/styles/variables.scss';
+
+#p-admin-advanced {
+ #input-customCSS {
+ font-size: $font-size-small;
+ font-family: $font-code;
+ }
+ ul {
+ li {
+ padding-bottom: 5px;
+ }
+ }
+}
\ No newline at end of file
diff --git a/public/pages/Administration/pages/AdvancedSettings.page.tsx b/public/pages/Administration/pages/AdvancedSettings.page.tsx
new file mode 100644
index 000000000..221c31103
--- /dev/null
+++ b/public/pages/Administration/pages/AdvancedSettings.page.tsx
@@ -0,0 +1,88 @@
+import "./AdvancedSettings.page.scss";
+
+import * as React from "react";
+
+import { CurrentUser } from "@fider/models";
+import { AdminBasePage } from "../components";
+import { DisplayError, TextArea, Form, Button, ButtonClickEvent } from "@fider/components";
+import { Failure, actions, page } from "@fider/services";
+
+interface AdvancedSettingsPageProps {
+ user: CurrentUser;
+ customCSS: string;
+}
+
+interface AdvancedSettingsPageState {
+ customCSS: string;
+ error?: Failure;
+}
+
+export class AdvancedSettingsPage extends AdminBasePage<AdvancedSettingsPageProps, AdvancedSettingsPageState> {
+ public id = "p-admin-advanced";
+ public name = "advanced";
+ public icon = "star";
+ public title = "Advanced";
+ public subtitle = "Manage your site settings";
+
+ constructor(props: AdvancedSettingsPageProps) {
+ super(props);
+
+ this.state = {
+ customCSS: this.props.customCSS
+ };
+ }
+
+ private save = async (e: ButtonClickEvent): Promise<void> => {
+ const result = await actions.updateTenantAdvancedSettings(this.state.customCSS);
+ if (result.ok) {
+ page.refresh();
+ } else {
+ this.setState({ error: result.error });
+ }
+ };
+
+ public content() {
+ return (
+ <Form error={this.state.error}>
+ <TextArea
+ field="customCSS"
+ label="Custom CSS"
+ disabled={!this.props.user.isAdministrator}
+ minRows={10}
+ value={this.state.customCSS}
+ onChange={customCSS => this.setState({ customCSS })}
+ >
+ <p className="info">
+ Custom CSS allows you to change the look and feel of Fider so that you can apply your own branding.
+ <br />
+ This is a powerful and flexibe feature, but requires basic understanding of{" "}
+ <a href="https://developer.mozilla.org/en-US/docs/Learn/CSS">CSS</a>.
+ </p>
+ <p className="info">
+ Custom CSS might break the design of your site as Fider evolves. By doing this, you're taking this risk, and
+ you will need to fix issues if they arise. <br /> You can minimize some issues by following these
+ recommendations:
+ </p>
+ <ul className="info">
+ <li>
+ <strong>Avoid nested selectors</strong>: Fider might change the structure of the HTML at any time, and
+ it's likely that such changes would invalidate some rules.
+ </li>
+ <li>
+ <strong>Keep it short</strong>: Customize only the essential. Avoid changing the style or structure of the
+ entire site.
+ </li>
+ </ul>
+ </TextArea>
+
+ {this.props.user.isAdministrator && (
+ <div className="field">
+ <Button color="positive" onClick={this.save}>
+ Save
+ </Button>
+ </div>
+ )}
+ </Form>
+ );
+ }
+}
diff --git a/public/pages/Administration/pages/Export.page.tsx b/public/pages/Administration/pages/Export.page.tsx
index a2a36196b..3363162ec 100644
--- a/public/pages/Administration/pages/Export.page.tsx
+++ b/public/pages/Administration/pages/Export.page.tsx
@@ -3,7 +3,7 @@ import "./PrivacySettings.page.scss";
import * as React from "react";
import { CurrentUser } from "@fider/models";
-import { Button } from "@fider/components/common";
+import { Button, Form, Field } from "@fider/components";
import { AdminBasePage } from "../components";
interface ExportPageProps {
@@ -19,16 +19,17 @@ export class ExportPage extends AdminBasePage<ExportPageProps, {}> {
public content() {
return (
- <div className="ui form">
- <div className="field">
- <label htmlFor="private">Export Ideas</label>
+ <Form>
+ <Field label="Export Ideas">
<p className="info">
Use this button to download a CSV file with all ideas in this site. This can be useful to analyse the data
with an external tool or simply to back it up.
</p>
+ </Field>
+ <Field>
<Button href="/admin/export/ideas.csv">Download</Button>
- </div>
- </div>
+ </Field>
+ </Form>
);
}
}
diff --git a/public/pages/Administration/pages/GeneralSettings.page.scss b/public/pages/Administration/pages/GeneralSettings.page.scss
index 1fabc20c8..943775a23 100644
--- a/public/pages/Administration/pages/GeneralSettings.page.scss
+++ b/public/pages/Administration/pages/GeneralSettings.page.scss
@@ -4,7 +4,7 @@ input[type='file'] {
display: none;
}
-.field.logo {
+.c-logo-upload {
img {
background-color: $white;
padding: 10px;
diff --git a/public/pages/Administration/pages/GeneralSettings.page.tsx b/public/pages/Administration/pages/GeneralSettings.page.tsx
index 60c960be0..babfd9d94 100644
--- a/public/pages/Administration/pages/GeneralSettings.page.tsx
+++ b/public/pages/Administration/pages/GeneralSettings.page.tsx
@@ -3,7 +3,7 @@ import "./GeneralSettings.page.scss";
import * as React from "react";
import { SystemSettings, CurrentUser, Tenant } from "@fider/models";
-import { Button, ButtonClickEvent, Textarea, DisplayError, Logo } from "@fider/components/common";
+import { Button, ButtonClickEvent, TextArea, DisplayError, Logo, Form, Input, Field } from "@fider/components/common";
import { actions, page, Failure, fileToBase64 } from "@fider/services";
import { AdminBasePage } from "../components";
@@ -114,64 +114,41 @@ export class GeneralSettingsPage extends AdminBasePage<GeneralSettingsPageProps,
: undefined;
return (
- <div className="ui form">
- <DisplayError fields={["title"]} error={this.state.error} />
- <div className="field">
- <label htmlFor="title">Title</label>
- <input
- id="title"
- type="text"
- maxLength={60}
- disabled={!this.props.user.isAdministrator}
- value={this.state.title}
- onChange={e => this.setState({ title: e.currentTarget.value })}
- />
- </div>
-
- <DisplayError fields={["welcomeMessage"]} error={this.state.error} />
- <div className="field">
- <label htmlFor="welcome-message">Welcome Message</label>
- <Textarea
- id="welcome-message"
- disabled={!this.props.user.isAdministrator}
- onChange={e => this.setState({ welcomeMessage: e.currentTarget.value })}
- value={this.state.welcomeMessage}
- />
- <p className="info">
- You can style and add links to your message, learn more at{" "}
- <a target="_blank" href="http://commonmark.org/help/">
- {"http://commonmark.org/help/"}
- </a>.
- </p>
- </div>
-
- <DisplayError fields={["invitation"]} error={this.state.error} />
- <div className="field">
- <label htmlFor="invitation">Invitation</label>
- <input
- id="invitation"
- type="text"
- maxLength={60}
- disabled={!this.props.user.isAdministrator}
- value={this.state.invitation}
- onChange={e => this.setState({ invitation: e.currentTarget.value })}
- />
- <p className="info">
- This is your customized message to invite visitors to share their ideas and suggestions.
- </p>
- </div>
-
- <DisplayError fields={["logo"]} error={this.state.error} />
- <div className="field logo">
- <label htmlFor="logo">Logo</label>
+ <Form error={this.state.error}>
+ <Input
+ field="title"
+ label="Title"
+ maxLength={60}
+ value={this.state.title}
+ disabled={!this.props.user.isAdministrator}
+ onChange={title => this.setState({ title })}
+ />
+ <TextArea
+ field="welcomeMessage"
+ label="Welcome Message"
+ value={this.state.welcomeMessage}
+ disabled={!this.props.user.isAdministrator}
+ onChange={welcomeMessage => this.setState({ welcomeMessage })}
+ />
+ <Input
+ field="invitation"
+ label="Invitation"
+ maxLength={60}
+ value={this.state.invitation}
+ disabled={!this.props.user.isAdministrator}
+ onChange={invitation => this.setState({ invitation })}
+ />
+
+ <Field label="Logo" className="c-logo-upload">
{hasFile && <Logo size={200} tenant={this.props.tenant} url={previewUrl} />}
- <input ref={e => (this.fileSelector = e)} type="file" name="logo" onChange={this.fileChanged} />
+ <input ref={e => (this.fileSelector = e)} type="file" onChange={this.fileChanged} />
+ <DisplayError fields={["logo"]} error={this.state.error} />
<div>
- <Button size="mini" onClick={this.selectFile} disabled={!this.props.user.isAdministrator}>
+ <Button size="tiny" onClick={this.selectFile} disabled={!this.props.user.isAdministrator}>
{hasFile ? "Change" : "Upload"}
</Button>
{hasFile && (
- <Button onClick={this.removeFile} size="mini" disabled={!this.props.user.isAdministrator}>
+ <Button onClick={this.removeFile} size="tiny" disabled={!this.props.user.isAdministrator}>
Remove
</Button>
)}
@@ -180,21 +157,18 @@ export class GeneralSettingsPage extends AdminBasePage<GeneralSettingsPageProps,
We accept JPG, GIF and PNG images, smaller than 100KB and with an aspect ratio of 1:1 with minimum
dimensions of 200x200 pixels.
</p>
- </div>
-
- {!page.isSingleHostMode() && [
- <DisplayError key={1} fields={["cname"]} error={this.state.error} />,
- <div key={2} className="field">
- <label htmlFor="cname">Custom Domain</label>
- <input
- id="cname"
- type="text"
- placeholder="feedback.yourcompany.com"
- maxLength={100}
- disabled={!this.props.user.isAdministrator}
- value={this.state.cname}
- onChange={e => this.setState({ cname: e.currentTarget.value })}
- />
+ </Field>
+
+ {!page.isSingleHostMode() && (
+ <Input
+ field="cname"
+ label="Custom Domain"
+ maxLength={100}
+ placeholder="feedback.yourcompany.com"
+ value={this.state.cname}
+ disabled={!this.props.user.isAdministrator}
+ onChange={cname => this.setState({ cname })}
+ >
<div className="info">
{this.state.cname ? (
[
@@ -208,20 +182,19 @@ export class GeneralSettingsPage extends AdminBasePage<GeneralSettingsPageProps,
) : (
<p>
Custom domains allow you to access your app via your own domain name (for example,{" "}
- <code>feedback.yourcomany.com</code>).
+ <code>feedback.yourcompany.com</code>).
</p>
)}
</div>
- </div>
- ]}
- {this.props.user.isAdministrator && (
- <div className="field">
- <Button color="positive" onClick={async e => await this.save(e)}>
- Save
- </Button>
- </div>
+ </Input>
)}
- </div>
+
+ <div className="field">
+ <Button disabled={!this.props.user.isAdministrator} color="positive" onClick={async e => await this.save(e)}>
+ Save
+ </Button>
+ </div>
+ </Form>
);
}
}
diff --git a/public/pages/Administration/pages/Invitations.page.tsx b/public/pages/Administration/pages/Invitations.page.tsx
index 81c977fb7..591bc7dd7 100644
--- a/public/pages/Administration/pages/Invitations.page.tsx
+++ b/public/pages/Administration/pages/Invitations.page.tsx
@@ -1,7 +1,7 @@
import * as React from "react";
import { SystemSettings, CurrentUser, Tenant } from "@fider/models";
-import { Button, ButtonClickEvent, Textarea, DisplayError } from "@fider/components/common";
+import { Button, ButtonClickEvent, TextArea, DisplayError, Form, Input, Field } from "@fider/components";
import { actions, notify, Failure } from "@fider/services";
import { AdminBasePage } from "../components";
@@ -51,8 +51,7 @@ ${this.props.user.name} (${this.props.tenant.name})`,
};
}
- private setRecipients = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
- const rawRecipients = e.currentTarget.value;
+ private setRecipients = (rawRecipients: string) => {
const recipients = rawRecipients.split(/\n|;|,|\s/gm).filter(x => !!x);
this.setState({ rawRecipients, recipients, numOfRecipients: recipients.length });
};
@@ -81,18 +80,15 @@ ${this.props.user.name} (${this.props.tenant.name})`,
public content() {
return (
- <div className="ui form">
- <DisplayError fields={["recipients"]} error={this.state.error} />
- <div className="field">
- <label htmlFor="recipients">Send invitations to</label>
- <Textarea
- id="recipients"
- rows={1}
- value={this.state.rawRecipients}
- minRows={1}
- onChange={this.setRecipients}
- />
+ <Form error={this.state.error}>
+ <TextArea
+ field="recipients"
+ label="Send invitations to"
+ minRows={1}
+ value={this.state.rawRecipients}
+ onChange={this.setRecipients}
+ >
<div className="info">
<p>
Input the list of all email addresses you wish to invite. Separate each address with either{" "}
@@ -101,46 +97,41 @@ ${this.props.user.name} (${this.props.tenant.name})`,
</p>
<p>You can send this invite to a maximum of 30 recipients each time.</p>
</div>
- </div>
- <DisplayError fields={["subject"]} error={this.state.error} />
- <div className="field">
- <label htmlFor="subject">Subject</label>
- <input
- id="subject"
- value={this.state.subject}
- type="text"
- maxLength={70}
- onChange={e => this.setState({ subject: e.currentTarget.value })}
- />
+ </TextArea>
+
+ <Input
+ field="subject"
+ label="Subject"
+ value={this.state.subject}
+ maxLength={70}
+ onChange={subject => this.setState({ subject })}
+ >
<p className="info">
This is the subject that will be used on the invitation email. Keep it short and sweet.
</p>
- </div>
- <DisplayError fields={["message"]} error={this.state.error} />
- <div className="field">
- <label htmlFor="message">Message</label>
- <Textarea
- id="message"
- value={this.state.message}
- rows={8}
- minRows={8}
- onChange={e => this.setState({ message: e.currentTarget.value })}
- />
+ </Input>
+
+ <TextArea
+ field="message"
+ label="Message"
+ minRows={8}
+ value={this.state.message}
+ onChange={message => this.setState({ message })}
+ >
<div className="info">
<p>
This is the content of the invite. Be polite and explain what this invite is for, otherwise there's a high
- change people will simply ignore your message.
+ change people will ignore your message.
</p>
<p>
You're allowed to write whatever you want as long as you include the invitation link placeholder named{" "}
<strong>%invite%</strong>.
</p>
</div>
- </div>
+ </TextArea>
- <div className="ui tiny header">Sample Invite</div>
-
- <div className="field">
+ <Field label="Sample Invite">
<p className="info">
We highly recommend to send yourself a sample email for you to verify if everything is correct before
inviting your list of contacts.
@@ -150,17 +141,15 @@ ${this.props.user.name} (${this.props.tenant.name})`,
) : (
<Button disabled={true}>Your profile doesn't have an email</Button>
)}
- </div>
-
- <div className="ui tiny header">Confirmation</div>
+ </Field>
- <div className="field">
+ <Field label="Confirmation">
<p className="info">Whenever you're ready, click the following button to send out these invites.</p>
<Button onClick={this.sendInvites} color="positive" disabled={this.state.numOfRecipients === 0}>
Send {this.state.numOfRecipients} {this.state.numOfRecipients === 1 ? "invite" : "invites"}
</Button>
- </div>
- </div>
+ </Field>
+ </Form>
);
}
}
diff --git a/public/pages/Administration/pages/ManageMembers.page.scss b/public/pages/Administration/pages/ManageMembers.page.scss
new file mode 100644
index 000000000..c7bf12dcf
--- /dev/null
+++ b/public/pages/Administration/pages/ManageMembers.page.scss
@@ -0,0 +1,8 @@
+#p-admin-members {
+ .c-list-item {
+ .content {
+ display: inline-block;
+ margin-left: 5px;
+ }
+ }
+}
\ No newline at end of file
diff --git a/public/pages/Administration/pages/ManageMembers.page.tsx b/public/pages/Administration/pages/ManageMembers.page.tsx
index e4d860340..a393561c3 100644
--- a/public/pages/Administration/pages/ManageMembers.page.tsx
+++ b/public/pages/Administration/pages/ManageMembers.page.tsx
@@ -1,8 +1,11 @@
+import "./ManageMembers.page.scss";
+
import * as React from "react";
-import { Button, Gravatar, UserName } from "@fider/components/common";
+import { Button, Gravatar, UserName, Segment, ListItem, List, Input, Form } from "@fider/components/common";
import { User, CurrentUser, UserRole } from "@fider/models";
import { actions } from "@fider/services";
import { AdminBasePage } from "../components";
+import { Divider } from "semantic-ui-react";
interface ManageMembersPageState {
administrators: User[];
@@ -62,29 +65,27 @@ export class ManageMembersPage extends AdminBasePage<ManageMembersPageProps, Man
}
return (
- <div key={user.id} className="item">
+ <ListItem>
<Gravatar user={user} />
<div className="content">
<UserName user={user} />
</div>
- <div className="right floated content">
- {removable && (
- <Button
- size="tiny"
- color="danger"
- onClick={() => this.changeRole(user, UserRole.Visitor)}
- className="showover"
- >
- <i className="remove icon" />Remove
- </Button>
- )}
- {addable && (
- <Button size="tiny" color="positive" onClick={() => this.changeRole(user, role)} className="showover">
- <i className="add icon" />Add
- </Button>
- )}
- </div>
- </div>
+ {removable && (
+ <Button
+ size="tiny"
+ color="danger"
+ onClick={() => this.changeRole(user, UserRole.Visitor)}
+ className="right showover"
+ >
+ <i className="remove icon" />Remove
+ </Button>
+ )}
+ {addable && (
+ <Button size="tiny" color="positive" onClick={() => this.changeRole(user, role)} className="right showover">
+ <i className="add icon" />Add
+ </Button>
+ )}
+ </ListItem>
);
}
@@ -109,63 +110,59 @@ export class ManageMembersPage extends AdminBasePage<ManageMembersPageProps, Man
public content() {
return (
- <div className="ui grid">
- <div className="eight wide computer sixteen wide mobile column">
- <div className="ui segment">
- <h4 className="ui header">Administrators</h4>
+ <div className="row">
+ <div className="col-lg-6">
+ <Segment>
+ <h4>Administrators</h4>
<p className="info">
Administrators have full access to edit and manage content, permissions and settings.
</p>
- <div className="ui middle aligned very relaxed selection list">
+ <List hover={true}>
{this.state.administrators.map(x => this.showUser(x, UserRole.Administrator, false, true))}
- </div>
+ </List>
{this.props.user.role === UserRole.Administrator && (
- <div className="ui mini form">
- <p>Add new administrator</p>
- <div className="mini field">
- <input
- type="text"
- value={this.state.newAdministratorFilter}
- onChange={x => this.filterVisitors("administrator", x.currentTarget.value)}
- placeholder="Search users by name"
- />
- </div>
- <div className="ui middle aligned very relaxed selection list">
+ <Form size="mini">
+ <Input
+ label="Add new administrator"
+ field="new-administrator"
+ value={this.state.newAdministratorFilter}
+ onChange={x => this.filterVisitors("administrator", x)}
+ placeholder="Search users by name"
+ />
+ <List hover={true}>
{this.state.filteredNewAdministrators.map(x => this.showUser(x, UserRole.Administrator, true, false))}
- </div>
+ </List>
{this.state.newAdministratorFilter &&
this.state.filteredNewAdministrators.length === 0 && <p className="info">No users to show.</p>}
- </div>
+ </Form>
)}
- </div>
+ </Segment>
</div>
- <div className="eight wide computer sixteen wide mobile column">
- <div className="ui segment">
- <h4 className="ui header">Collaborators</h4>
+ <div className="col-lg-6">
+ <Segment>
+ <h4>Collaborators</h4>
<p className="info">Collaborators can edit and manage content, but not permissions and settings.</p>
- <div className="ui middle aligned very relaxed selection list">
+ <List hover={true}>
{this.state.collaborators.map(x => this.showUser(x, UserRole.Collaborator, false, true))}
- </div>
+ </List>
{this.props.user.role === UserRole.Administrator && (
- <div className="ui mini form">
- <p>Add new collaborator</p>
- <div className="mini field">
- <input
- type="text"
- value={this.state.newCollaboratorFilter}
- onChange={x => this.filterVisitors("collaborator", x.currentTarget.value)}
- placeholder="Search users by name"
- />
- </div>
- <div className="ui middle aligned very relaxed selection list">
+ <Form size="mini">
+ <Input
+ label="Add new collaborator"
+ field="new-collaborator"
+ value={this.state.newCollaboratorFilter}
+ onChange={x => this.filterVisitors("collaborator", x)}
+ placeholder="Search users by name"
+ />
+ <List hover={true}>
{this.state.filteredNewCollaborators.map(x => this.showUser(x, UserRole.Collaborator, true, false))}
- </div>
+ </List>
{this.state.newCollaboratorFilter &&
this.state.filteredNewCollaborators.length === 0 && <p className="info">No users to show.</p>}
- </div>
+ </Form>
)}
- </div>
+ </Segment>
</div>
</div>
);
diff --git a/public/pages/Administration/pages/ManageTags.page.scss b/public/pages/Administration/pages/ManageTags.page.scss
new file mode 100644
index 000000000..fd163d0bc
--- /dev/null
+++ b/public/pages/Administration/pages/ManageTags.page.scss
@@ -0,0 +1,8 @@
+#p-admin-tags {
+ .c-list-item {
+ .content {
+ display: inline-block;
+ margin-left: 5px;
+ }
+ }
+}
\ No newline at end of file
diff --git a/public/pages/Administration/pages/ManageTags.page.tsx b/public/pages/Administration/pages/ManageTags.page.tsx
index f4dbe8233..eff9dcb3a 100644
--- a/public/pages/Administration/pages/ManageTags.page.tsx
+++ b/public/pages/Administration/pages/ManageTags.page.tsx
@@ -1,5 +1,7 @@
+import "./ManageTags.page.scss";
+
import * as React from "react";
-import { ShowTag, Button, Gravatar, UserName } from "@fider/components";
+import { ShowTag, Button, Gravatar, UserName, Segment, List, ListItem } from "@fider/components";
import { AdminBasePage, TagForm, TagFormState } from "../components";
import { Tag, CurrentUser, UserRole } from "@fider/models";
@@ -74,7 +76,7 @@ export class ManageTagsPage extends AdminBasePage<ManageTagsPageProps, ManageTag
return this.state.allTags.map(t => {
if (this.state.editing === t.id) {
return (
- <div key={t.id} className="item">
+ <ListItem key={t.id}>
<TagForm
name={t.name}
color={t.color}
@@ -82,31 +84,31 @@ export class ManageTagsPage extends AdminBasePage<ManageTagsPageProps, ManageTag
onSave={async data => this.updateTag(t, data)}
onCancel={() => this.setState({ editing: undefined })}
/>
- </div>
+ </ListItem>
);
}
if (this.state.deleting === t.id) {
return (
- <div key={t.id} className="item">
+ <ListItem key={t.id}>
<div className="content">
<b>Are you sure?</b>{" "}
<span>
The tag <ShowTag tag={t} /> will be removed from all ideas.
</span>
</div>
- <Button className="right floated" onClick={async () => this.setState({ deleting: undefined })}>
+ <Button className="right" onClick={async () => this.setState({ deleting: undefined })}>
Cancel
</Button>
- <Button color="danger" className="right floated" onClick={() => this.deleteTag(t)}>
+ <Button color="danger" className="right" onClick={() => this.deleteTag(t)}>
Delete tag
</Button>
- </div>
+ </ListItem>
);
}
return (
- <div key={t.id} className="item">
+ <ListItem key={t.id}>
<ShowTag tag={t} />
{this.props.user.isAdministrator && [
<Button
@@ -118,7 +120,7 @@ export class ManageTagsPage extends AdminBasePage<ManageTagsPageProps, ManageTag
deleting: t.id
})
}
- className="right floated"
+ className="right"
>
<i className="remove icon" />Remove
</Button>,
@@ -131,12 +133,12 @@ export class ManageTagsPage extends AdminBasePage<ManageTagsPageProps, ManageTag
deleting: undefined
})
}
- className="right floated"
+ className="right"
>
<i className="edit icon" />Edit
</Button>
]}
- </div>
+ </ListItem>
);
});
}
@@ -147,9 +149,9 @@ export class ManageTagsPage extends AdminBasePage<ManageTagsPageProps, ManageTag
const form =
this.props.user.isAdministrator &&
(this.state.isAdding ? (
- <div className="ui segment">
+ <Segment>
<TagForm onSave={async data => this.saveNewTag(data)} onCancel={() => this.setState({ isAdding: false })} />
- </div>
+ </Segment>
) : (
<Button
color="positive"
@@ -168,11 +170,9 @@ export class ManageTagsPage extends AdminBasePage<ManageTagsPageProps, ManageTag
return (
<>
{form}
- <div className="ui segment">
- <div className="ui middle aligned very relaxed divided list">
- {list.length ? list : <div className="content">There aren’t any tags yet.</div>}
- </div>
- </div>
+ <Segment>
+ <List divided={true}>{list.length ? list : <div className="content">There aren’t any tags yet.</div>}</List>
+ </Segment>
</>
);
}
diff --git a/public/pages/Administration/pages/PrivacySettings.page.tsx b/public/pages/Administration/pages/PrivacySettings.page.tsx
index f336ed0a9..14b3a4ef3 100644
--- a/public/pages/Administration/pages/PrivacySettings.page.tsx
+++ b/public/pages/Administration/pages/PrivacySettings.page.tsx
@@ -3,7 +3,7 @@ import "./PrivacySettings.page.scss";
import * as React from "react";
import { SystemSettings, CurrentUser, Tenant } from "@fider/models";
-import { Button, ButtonClickEvent, Textarea, DisplayError, Toggle } from "@fider/components/common";
+import { Button, ButtonClickEvent, DisplayError, Toggle, Form } from "@fider/components/common";
import { actions, notify, Failure } from "@fider/services";
import { AdminBasePage } from "../components";
@@ -47,18 +47,16 @@ export class PrivacySettingsPage extends AdminBasePage<PrivacySettingsPageProps,
public content() {
return (
- <div className="ui form">
- <div className="field">
- <label htmlFor="private">
- Private site
- <Toggle disabled={!this.props.user.isAdministrator} active={this.state.isPrivate} onToggle={this.toggle} />
- </label>
+ <Form>
+ <div className="c-form-field">
+ <label htmlFor="private">Private site</label>
+ <Toggle disabled={!this.props.user.isAdministrator} active={this.state.isPrivate} onToggle={this.toggle} />
<p className="info">
A private site prevents unauthenticated users from viewing or interacting with its content. <br /> If
enabled, only already registered and invited users will be able to sign in to this site.
</p>
</div>
- </div>
+ </Form>
);
}
}
diff --git a/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx b/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx
index e58bdeb5f..9ff33eb73 100644
--- a/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx
+++ b/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx
@@ -1,15 +1,15 @@
import * as React from "react";
import { HomePage, HomePageProps, SignInPage } from "../";
-import { Modal, Form, Button } from "@fider/components/common";
-import { page, actions } from "@fider/services";
+import { Modal, Button, Form, Input } from "@fider/components";
+import { page, actions, Failure } from "@fider/services";
interface CompleteSignInProfilePageState {
name: string;
+ error?: Failure;
}
export class CompleteSignInProfilePage extends React.Component<HomePageProps, CompleteSignInProfilePageState> {
- private form!: Form;
private key: string;
constructor(props: HomePageProps) {
@@ -25,7 +25,7 @@ export class CompleteSignInProfilePage extends React.Component<HomePageProps, Co
if (result.ok) {
location.href = "/";
} else if (result.error) {
- this.form.setFailure(result.error);
+ this.setState({ error: result.error });
}
}
@@ -36,23 +36,18 @@ export class CompleteSignInProfilePage extends React.Component<HomePageProps, Co
<Modal.Header>Complete your profile</Modal.Header>
<Modal.Content>
<p>Because this is your first sign in, please input your display name.</p>
- <Form
- ref={f => {
- this.form = f!;
- }}
- >
- <div className="ui small action fluid input">
- <input
- onChange={e => this.setState({ name: e.currentTarget.value })}
- type="text"
- maxLength={100}
- placeholder="Your display name"
- className="small"
- />
- <Button onClick={() => this.submit()} color="positive" disabled={this.state.name === ""}>
- Submit
- </Button>
- </div>
+ <Form error={this.state.error}>
+ <Input
+ field="name"
+ onChange={name => this.setState({ name })}
+ maxLength={100}
+ placeholder="Your display name"
+ suffix={
+ <Button onClick={() => this.submit()} color="positive" disabled={this.state.name === ""}>
+ Submit
+ </Button>
+ }
+ />
</Form>
</Modal.Content>
</Modal.Window>
diff --git a/public/pages/Home/Home.page.scss b/public/pages/Home/Home.page.scss
index ba461fbfa..915ba8cf3 100644
--- a/public/pages/Home/Home.page.scss
+++ b/public/pages/Home/Home.page.scss
@@ -6,53 +6,30 @@
margin-bottom: 20px;
}
- .c-idea-list {
- > .item {
- border-top: 0.1px solid $gray-lighter;
- &:first-child {
- border-top: none;
- }
-
- .title {
- max-width: 85%;
- font-size: 18px;
- }
-
- .content {
- width: calc(100% - 55px);
- }
-
- .description {
- color:rgba(0, 0, 0, 0.5) !important;
- min-height: 20px;
- margin-bottom: 10px;
- }
- }
- .show-more {
- cursor: pointer;
- margin-left: 55px;
+ .l-ideas-filter {
+ .counter {
+ font-size: 8px;
+ background-color: $gray-lighter;
+ color: $text-color;
+ display: inline-block;
+ min-width: 15px;
+ padding: 0px 5px;
+ margin-left: 5px;
+ text-align: center;
+ border-radius: 10px;
+ vertical-align: top;
+ font-weight: 600;
}
}
- .ideas-filter {
- .item {
- .label {
- position: absolute;
- font-size: 8px;
- margin-left: 5px;
- }
- }
- }
-
- .tags-filter {
- .ui.empty.circular.label {
- font-size: .71428571rem;
- margin-right: 5px;
- }
+ .l-tags-filter {
.selected.item {
background-color: transparent;
font-weight: normal;
}
+ .c-tag {
+ margin-right: 5px;
+ }
i.check {
color: transparent;
}
@@ -63,24 +40,14 @@
}
}
- @include media("phone") {
- .filter-column {
- padding-right: 0;
- }
-
- .search-column {
- padding-left: 0;
- }
- }
-
- #new-idea-input {
+ #input-title {
margin-bottom: 20px;
border: none;
border-bottom: 1px dashed $gray-darker;
background-color: transparent;
font-size: 18px;
padding: 0px 0px 10px 0px;
- font-weight: 700;
+ font-weight: 600;
margin: 0px 0px 10px 0px;
border-radius: 0;
}
diff --git a/public/pages/Home/Home.page.tsx b/public/pages/Home/Home.page.tsx
index ec274d49a..0bc6662e9 100644
--- a/public/pages/Home/Home.page.tsx
+++ b/public/pages/Home/Home.page.tsx
@@ -43,9 +43,9 @@ export class HomePage extends React.Component<HomePageProps, HomePageState> {
public render() {
return (
- <div id="p-home" className="page ui container">
- <div className="ui grid stackable">
- <div className="six wide column">
+ <div id="p-home" className="page container">
+ <div className="row">
+ <div className="col-md-5">
<MultiLineText
className="welcome-message"
text={this.props.tenant.welcomeMessage || defaultWelcomeMessage}
@@ -57,7 +57,7 @@ export class HomePage extends React.Component<HomePageProps, HomePageState> {
onTitleChanged={title => this.setState({ title })}
/>
</div>
- <div className="ten wide column">
+ <div className="col-md-7">
{Object.keys(this.props.countPerStatus).length === 0 ? (
<Lonely />
) : (
diff --git a/public/pages/Home/components/IdeaFilter.tsx b/public/pages/Home/components/IdeaFilter.tsx
index e7be09709..020eb2676 100644
--- a/public/pages/Home/components/IdeaFilter.tsx
+++ b/public/pages/Home/components/IdeaFilter.tsx
@@ -27,7 +27,7 @@ export class IdeaFilter extends React.Component<IdeaFilterProps, {}> {
value: s.slug,
content: (
<span>
- {s.title} <a className="ui mini circular label">{this.props.countPerStatus[s.value]}</a>
+ {s.title} <a className="counter">{this.props.countPerStatus[s.value]}</a>
</span>
)
});
@@ -40,7 +40,7 @@ export class IdeaFilter extends React.Component<IdeaFilterProps, {}> {
<>
Show{" "}
<Dropdown
- className="ideas-filter"
+ className="l-ideas-filter"
header="What do you want to see?"
inline={true}
options={options}
diff --git a/public/pages/Home/components/IdeaInput.tsx b/public/pages/Home/components/IdeaInput.tsx
index 3d08602cf..6b00a2951 100644
--- a/public/pages/Home/components/IdeaInput.tsx
+++ b/public/pages/Home/components/IdeaInput.tsx
@@ -1,5 +1,5 @@
import * as React from "react";
-import { DisplayError, Button, ButtonClickEvent, Form, Textarea } from "@fider/components/common";
+import { DisplayError, Button, ButtonClickEvent, Input, Form, TextArea } from "@fider/components";
import { SignInModal } from "@fider/components";
import { page, cache, actions, Failure } from "@fider/services";
import { CurrentUser } from "@fider/models";
@@ -15,6 +15,7 @@ interface IdeaInputState {
description: string;
focused: boolean;
showSignIn: boolean;
+ error?: Failure;
}
const CACHE_TITLE_KEY = "IdeaInput-Title";
@@ -22,7 +23,6 @@ const CACHE_DESCRIPTION_KEY = "IdeaInput-Description";
export class IdeaInput extends React.Component<IdeaInputProps, IdeaInputState> {
private title?: HTMLInputElement;
- private form?: Form;
constructor(props: IdeaInputProps) {
super(props);
@@ -65,50 +65,43 @@ export class IdeaInput extends React.Component<IdeaInputProps, IdeaInputState> {
if (this.state.title) {
const result = await actions.createIdea(this.state.title, this.state.description);
if (result.ok) {
- if (this.form) {
- this.form.clearFailure();
- }
+ this.setState({ error: undefined });
cache.remove(CACHE_TITLE_KEY, CACHE_DESCRIPTION_KEY);
location.href = `/ideas/${result.data.number}/${result.data.slug}`;
event.preventEnable();
- } else if (result.error && this.form) {
- this.form.setFailure(result.error);
+ } else if (result.error) {
+ this.setState({ error: result.error });
}
}
}
public render() {
const details = (
- <div>
- <div className="field">
- <Textarea
- onChange={e => this.onDescriptionChanged(e.currentTarget.value)}
- defaultValue={this.state.description}
- placeholder="Describe your idea"
- />
- </div>
+ <>
+ <TextArea
+ field="description"
+ onChange={description => this.onDescriptionChanged(description)}
+ value={this.state.description}
+ minRows={5}
+ placeholder="Describe your idea"
+ />
<Button color="positive" onClick={e => this.submit(e)}>
Submit
</Button>
- </div>
+ </>
);
return (
<>
<SignInModal isOpen={this.state.showSignIn} />
- <Form
- ref={f => {
- this.form = f!;
- }}
- >
- <input
- id="new-idea-input"
- type="text"
- ref={e => (this.title = e!)}
+ <Form error={this.state.error}>
+ <Input
+ field="title"
+ inputRef={e => (this.title = e!)}
onFocus={() => this.onTitleFocused()}
maxLength={100}
- defaultValue={this.state.title}
- onChange={e => this.onTitleChanged(e.currentTarget.value)}
+ value={this.state.title}
+ onChange={title => this.onTitleChanged(title)}
placeholder={this.props.placeholder}
/>
{this.state.title && details}
diff --git a/public/pages/Home/components/IdeasContainer.tsx b/public/pages/Home/components/IdeasContainer.tsx
index 0a9367523..59e553af6 100644
--- a/public/pages/Home/components/IdeasContainer.tsx
+++ b/public/pages/Home/components/IdeasContainer.tsx
@@ -3,7 +3,7 @@ import * as React from "react";
import { IdeaInput, ListIdeas, TagsFilter, IdeaFilter } from "../";
import { Idea, Tag, IdeaStatus, CurrentUser } from "@fider/models";
-import { Loader, MultiLineText } from "@fider/components";
+import { Loader, MultiLineText, Heading, Field, Input } from "@fider/components";
import { page, actions } from "@fider/services";
interface IdeasContainerProps {
@@ -84,13 +84,13 @@ export class IdeasContainer extends React.Component<IdeasContainerProps, IdeasCo
if (this.props.newIdeaTitle) {
return (
<>
- <h3 className="ui dividing header">
- <i className="lightbulb icon gm-primary" />
- <div className="content">
- Similar ideas
- <div className="sub header">Consider voting on existing ideas before posting a new one.</div>
- </div>
- </h3>
+ <Heading
+ title="Similar ideas"
+ subtitle="Consider voting on existing ideas before posting a new one."
+ icon="lightbulb"
+ level={3}
+ dividing={true}
+ />
{this.state.loading ? (
<Loader />
) : (
@@ -107,10 +107,10 @@ export class IdeasContainer extends React.Component<IdeasContainerProps, IdeasCo
return (
<>
- <div className="ui grid">
+ <div className="row">
{!this.state.query && (
- <div className="eleven wide mobile eleven wide tablet twelve wide computer column filter-column">
- <div className="content">
+ <div className="col-sm-7 col-md-8 col-lg-9">
+ <Field>
<IdeaFilter
activeFilter={this.state.filter}
filterChanged={filter => this.changeFilterCriteria({ filter })}
@@ -121,29 +121,18 @@ export class IdeasContainer extends React.Component<IdeasContainerProps, IdeasCo
selectionChanged={tags => this.changeFilterCriteria({ tags })}
defaultSelection={this.state.tags}
/>
- </div>
+ </Field>
</div>
)}
- <div
- className={
- !this.state.query ? `five wide mobile five wide tablet four wide computer column search-column` : "column"
- }
- >
- <div className="ui search">
- <div className="ui icon fluid input">
- <input
- onChange={x => this.changeFilterCriteria({ query: x.currentTarget.value }, 200)}
- value={this.state.query}
- type="text"
- placeholder="Search..."
- />
- {this.state.query ? (
- <i onClick={() => this.changeFilterCriteria({ query: "" })} className="cancel link icon" />
- ) : (
- <i className="search icon" />
- )}
- </div>
- </div>
+ <div className={!this.state.query ? `col-sm-5 col-md-4 col-lg-3` : "col-sm-12"}>
+ <Input
+ field="query"
+ icon={this.state.query ? "cancel" : "search"}
+ onIconClick={this.state.query ? () => this.changeFilterCriteria({ query: "" }) : undefined}
+ placeholder="Search..."
+ value={this.state.query}
+ onChange={query => this.changeFilterCriteria({ query }, 200)}
+ />
</div>
</div>
{this.state.loading ? (
diff --git a/public/pages/Home/components/ListIdeas.scss b/public/pages/Home/components/ListIdeas.scss
new file mode 100644
index 000000000..f9df8796b
--- /dev/null
+++ b/public/pages/Home/components/ListIdeas.scss
@@ -0,0 +1,38 @@
+@import '~@fider/assets/styles/variables.scss';
+
+.c-idea-list {
+ margin-top: 10px;
+
+ .c-list-item {
+ display: flex;
+ border-top-width: 0.1px !important;
+
+ .c-list-item-title {
+ color: $text-color;
+ display: block;
+ max-width: 85%;
+ margin-bottom: 10px;
+ font-size: $font-size-big;
+ &:hover {
+ color: $main-color;
+ }
+ }
+
+ .c-list-item-content {
+ width: calc(100% - 55px);
+ display: block;
+ }
+
+ .c-list-item-description {
+ color: $gray-darkest;
+ min-height: 20px;
+ margin-bottom: 10px;
+ }
+ }
+
+ .c-idea-list-show-more {
+ cursor: pointer;
+ color: $main-color;
+ margin-left: 55px;
+ }
+}
\ No newline at end of file
diff --git a/public/pages/Home/components/ListIdeas.tsx b/public/pages/Home/components/ListIdeas.tsx
index e1745d302..f2503e7e4 100644
--- a/public/pages/Home/components/ListIdeas.tsx
+++ b/public/pages/Home/components/ListIdeas.tsx
@@ -1,6 +1,17 @@
+import "./ListIdeas.scss";
+
import * as React from "react";
import { Idea, Tag, IdeaStatus, CurrentUser } from "@fider/models";
-import { ShowTag, ShowIdeaResponse, SupportCounter, Gravatar, MultiLineText, Moment } from "@fider/components";
+import {
+ ShowTag,
+ ShowIdeaResponse,
+ SupportCounter,
+ Gravatar,
+ MultiLineText,
+ Moment,
+ ListItem,
+ List
+} from "@fider/components";
const defaultShowCount = 20;
@@ -17,22 +28,22 @@ interface ListIdeasState {
const ListIdeaItem = (props: { idea: Idea; user?: CurrentUser; tags: Tag[] }) => {
return (
- <div className="item">
+ <ListItem>
<SupportCounter user={props.user} idea={props.idea} />
- <div className="content">
+ <div className="c-list-item-content">
{props.idea.totalComments > 0 && (
<div className="info right">
{props.idea.totalComments} <i className="comments outline icon" />
</div>
)}
- <a className="title gm-text gm-primary-hover" href={`/ideas/${props.idea.number}/${props.idea.slug}`}>
+ <a className="c-list-item-title" href={`/ideas/${props.idea.number}/${props.idea.slug}`}>
{props.idea.title}
</a>
- <MultiLineText className="description" text={props.idea.description} style="simple" />
+ <MultiLineText className="c-list-item-description" text={props.idea.description} style="simple" />
<ShowIdeaResponse status={props.idea.status} response={props.idea.response} />
{props.tags.map(tag => <ShowTag key={tag.id} size="mini" tag={tag} />)}
</div>
- </div>
+ </ListItem>
);
};
@@ -58,7 +69,7 @@ export class ListIdeas extends React.Component<ListIdeasProps, ListIdeasState> {
const ideasToList = this.props.ideas.slice(0, this.state.showCount);
return (
- <div className="ui divided unstackable items c-idea-list">
+ <List className="c-idea-list" divided={true}>
{ideasToList.map(idea => (
<ListIdeaItem
key={idea.id}
@@ -68,11 +79,11 @@ export class ListIdeas extends React.Component<ListIdeasProps, ListIdeasState> {
/>
))}
{this.props.ideas.length > this.state.showCount && (
- <h5 className="gm-primary show-more" onTouchEnd={e => this.showMore(e)} onClick={e => this.showMore(e)}>
+ <h5 className="c-idea-list-show-more" onTouchEnd={e => this.showMore(e)} onClick={e => this.showMore(e)}>
View {this.props.ideas.length - this.state.showCount} more ideas
</h5>
)}
- </div>
+ </List>
);
}
}
diff --git a/public/pages/Home/components/TagsFilter.tsx b/public/pages/Home/components/TagsFilter.tsx
index a95225212..8eeb168c0 100644
--- a/public/pages/Home/components/TagsFilter.tsx
+++ b/public/pages/Home/components/TagsFilter.tsx
@@ -45,7 +45,7 @@ export class TagsFilter extends React.Component<TagsFilterProps, TagsFilterState
content: (
<div className={this.state.selected.indexOf(t.slug) >= 0 ? "selected-tag" : ""}>
<i className="icon check" />
- <ShowTag tag={t} circular={true} />
+ <ShowTag tag={t} size="mini" circular={true} />
{t.name}
</div>
)
@@ -63,7 +63,7 @@ export class TagsFilter extends React.Component<TagsFilterProps, TagsFilterState
<>
with{" "}
<Dropdown
- className="tags-filter"
+ className="l-tags-filter"
selectOnBlur={false}
text={text}
defaultValue="0"
diff --git a/public/pages/MyNotifications/MyNotifications.page.tsx b/public/pages/MyNotifications/MyNotifications.page.tsx
index a210ed992..c6966a33a 100644
--- a/public/pages/MyNotifications/MyNotifications.page.tsx
+++ b/public/pages/MyNotifications/MyNotifications.page.tsx
@@ -3,7 +3,7 @@ import "./MyNotifications.page.scss";
import * as React from "react";
import { CurrentUser, Notification } from "@fider/models";
-import { MultiLineText, Moment } from "@fider/components";
+import { MultiLineText, Moment, Heading, List, ListItem } from "@fider/components";
import { page, actions } from "@fider/services";
interface MyNotificationsPageProps {
@@ -36,14 +36,14 @@ export class MyNotificationsPage extends React.Component<MyNotificationsPageProp
private items(notifications: Notification[]): JSX.Element[] {
return notifications.map(n => {
return (
- <span key={n.id} className="item">
+ <ListItem key={n.id}>
<a href={`/notifications/${n.id}`}>
<MultiLineText text={n.title} style="simple" />
<span className="info">
<Moment date={n.createdOn} />
</span>
</a>
- </span>
+ </ListItem>
);
});
}
@@ -57,37 +57,29 @@ export class MyNotificationsPage extends React.Component<MyNotificationsPageProp
public render() {
return (
- <div id="p-my-notifications" className="page ui container">
- <h2 className="ui header">
- <i className="circular id bell icon" />
- <div className="content">
- Notifications
- <div className="sub header">Stay up to date with what's happening</div>
- </div>
- </h2>
+ <div id="p-my-notifications" className="page container">
+ <Heading title="Notifications" subtitle="Stay up to date with what's happening" icon="bell" />
- <div className="ui grid">
- <div className="ten wide computer sixteen wide mobile column">
- <h4>
- Unread
- {this.state.unread.length > 0 && (
- <span className="mark-as-read" onClick={() => this.markAllAsRead()}>
- Mark All as Read
- </span>
- )}
- </h4>
- <div className="ui list">
- {this.state.unread.length > 0 && this.items(this.state.unread)}
- {this.state.unread.length === 0 && <span className="info">No unread notifications.</span>}
- </div>
- {this.state.recent.length > 0 && (
- <>
- <h4>Read on last 30 days</h4>
- <div className="ui list">{this.items(this.state.recent)}</div>
- </>
- )}
- </div>
- </div>
+ <h4>
+ Unread
+ {this.state.unread.length > 0 && (
+ <span className="mark-as-read" onClick={() => this.markAllAsRead()}>
+ Mark All as Read
+ </span>
+ )}
+ </h4>
+ <List>
+ {this.state.unread.length > 0 && this.items(this.state.unread)}
+ {this.state.unread.length === 0 && <span className="info">No unread notifications.</span>}
+ </List>
+ {this.state.recent.length > 0 && (
+ <>
+ <h4>Read on last 30 days</h4>
+ <List>
+ <ListItem>{this.items(this.state.recent)}</ListItem>
+ </List>
+ </>
+ )}
</div>
);
}
diff --git a/public/pages/MySettings/MySettings.page.scss b/public/pages/MySettings/MySettings.page.scss
index 7e1e115af..ec47f5d22 100644
--- a/public/pages/MySettings/MySettings.page.scss
+++ b/public/pages/MySettings/MySettings.page.scss
@@ -4,6 +4,7 @@
}
.notifications-settings {
+ margin-bottom: 15px;
.c-toggle {
margin-right: 20px;
}
diff --git a/public/pages/MySettings/MySettings.page.tsx b/public/pages/MySettings/MySettings.page.tsx
index 47ac3c43c..83659d873 100644
--- a/public/pages/MySettings/MySettings.page.tsx
+++ b/public/pages/MySettings/MySettings.page.tsx
@@ -2,7 +2,7 @@ import "./MySettings.page.scss";
import * as React from "react";
-import { Modal, Form, DisplayError, Button, Gravatar } from "@fider/components/common";
+import { Modal, Form, DisplayError, Button, Gravatar, Heading, Field, Input } from "@fider/components";
import { NotificationSettings } from "./";
import { CurrentUser, UserSettings } from "@fider/models";
@@ -34,16 +34,16 @@ export class MySettingsPage extends React.Component<MySettingsPageProps, MySetti
};
}
- private async confirm() {
+ private confirm = async () => {
const result = await actions.updateUserSettings(this.state.name, this.state.settings);
if (result.ok) {
location.reload();
} else if (result.error) {
this.setState({ error: result.error });
}
- }
+ };
- private async submitNewEmail() {
+ private submitNewEmail = async () => {
const result = await actions.changeUserEmail(this.state.newEmail);
if (result.ok) {
this.setState({
@@ -54,11 +54,17 @@ export class MySettingsPage extends React.Component<MySettingsPageProps, MySetti
} else if (result.error) {
this.setState({ error: result.error });
}
- }
+ };
public render() {
+ const changeEmail = (
+ <span className="ui info clickable" onClick={() => this.setState({ changingEmail: true })}>
+ change
+ </span>
+ );
+
return (
- <div id="p-my-settings" className="page ui container">
+ <div id="p-my-settings" className="page container">
<Modal.Window isOpen={this.state.showModal} canClose={true} center={true}>
<Modal.Header>Confirm your new email</Modal.Header>
<Modal.Content>
@@ -76,19 +82,12 @@ export class MySettingsPage extends React.Component<MySettingsPageProps, MySetti
</Modal.Content>
</Modal.Window>
- <h2 className="ui header">
- <i className="circular id badge icon" />
- <div className="content">
- Settings
- <div className="sub header">Manage your profile settings</div>
- </div>
- </h2>
+ <Heading title="Settings" subtitle="Manage your profile settings" icon="id badge" />
- <div className="ui grid">
- <div className="ten wide computer sixteen wide mobile column">
- <div className="ui form">
- <div className="field">
- <label htmlFor="email">Avatar</label>
+ <div className="row">
+ <div className="col-lg-7">
+ <Form error={this.state.error}>
+ <Field label="Avatar">
<p>
<Gravatar user={this.props.user} />
</p>
@@ -102,65 +101,50 @@ export class MySettingsPage extends React.Component<MySettingsPageProps, MySetti
A letter avatar based on your name is generated for profiles without a Gravatar.
</p>
</div>
- </div>
- <DisplayError fields={["email"]} error={this.state.error} />
- <div className="field">
- <label htmlFor="email">
- Email <span className="info">Your email is private and will never be displayed to anyone.</span>
- </label>
- {this.state.changingEmail ? (
+ </Field>
+
+ <Input
+ label="Email"
+ field="email"
+ value={this.state.changingEmail ? this.state.newEmail : this.props.user.email}
+ maxLength={200}
+ disabled={!this.state.changingEmail}
+ afterLabel={this.state.changingEmail ? undefined : changeEmail}
+ onChange={newEmail => this.setState({ newEmail })}
+ >
+ <p className="info">
+ {this.props.user.email || this.state.changingEmail
+ ? "Your email is private and will never be displayed to anyone"
+ : "Your account doesn't have an email."}
+ </p>
+ {this.state.changingEmail && (
<>
- <p>
- <input
- id="new-email"
- type="text"
- style={{ maxWidth: "200px", marginRight: "10px" }}
- maxLength={200}
- placeholder={this.props.user.email}
- value={this.state.newEmail}
- onChange={e => this.setState({ newEmail: e.currentTarget.value })}
- />
- <Button color="positive" size="mini" onClick={async () => await this.submitNewEmail()}>
- Confirm
- </Button>
- <Button
- size="mini"
- onClick={async () =>
- this.setState({
- changingEmail: false,
- error: undefined
- })
- }
- >
- Cancel
- </Button>
- </p>
+ <Button color="positive" size="mini" onClick={this.submitNewEmail}>
+ Confirm
+ </Button>
+ <Button
+ size="mini"
+ onClick={async () =>
+ this.setState({
+ changingEmail: false,
+ newEmail: "",
+ error: undefined
+ })
+ }
+ >
+ Cancel
+ </Button>
</>
- ) : (
- <p>
- {this.props.user.email ? (
- <b>{this.props.user.email}</b>
- ) : (
- <span className="info">Your account doesn't have an email.</span>
- )}
- <span className="ui info clickable" onClick={() => this.setState({ changingEmail: true })}>
- change
- </span>
- </p>
)}
- </div>
-
- <DisplayError fields={["name"]} error={this.state.error} />
- <div className="field">
- <label htmlFor="name">Name</label>
- <input
- id="name"
- type="text"
- maxLength={100}
- value={this.state.name}
- onChange={e => this.setState({ name: e.currentTarget.value })}
- />
- </div>
+ </Input>
+
+ <Input
+ label="Name"
+ field="name"
+ value={this.state.name}
+ maxLength={100}
+ onChange={name => this.setState({ name })}
+ />
<NotificationSettings
user={this.props.user}
@@ -168,12 +152,10 @@ export class MySettingsPage extends React.Component<MySettingsPageProps, MySetti
settingsChanged={settings => this.setState({ settings })}
/>
- <div className="field">
- <Button color="positive" onClick={async () => await this.confirm()}>
- Confirm
- </Button>
- </div>
- </div>
+ <Button color="positive" onClick={this.confirm}>
+ Confirm
+ </Button>
+ </Form>
</div>
</div>
</div>
diff --git a/public/pages/MySettings/components/NotificationSettings.tsx b/public/pages/MySettings/components/NotificationSettings.tsx
index b5833cc14..d9e64882b 100644
--- a/public/pages/MySettings/components/NotificationSettings.tsx
+++ b/public/pages/MySettings/components/NotificationSettings.tsx
@@ -1,7 +1,7 @@
import * as React from "react";
import { CurrentUser, UserSettings } from "@fider/models";
-import { Toggle } from "@fider/components";
+import { Toggle, Segment, Segments, Field } from "@fider/components";
interface NotificationSettingsProps {
user: CurrentUser;
@@ -90,44 +90,49 @@ export class NotificationSettings extends React.Component<NotificationSettingsPr
public render() {
return (
<>
- <div className="field">
- <label htmlFor="notifications">Notifications</label>
+ <Field label="Notifications">
<p className="info">Use following panel to choose which events you'd like to receive notification</p>
- </div>
+ </Field>
- <div className="ui segments notifications-settings">
- <div className="ui segment">
- <span className="event-title">New Idea</span>
- {this.info("event_notification_new_idea", "new ideas posted on this site", "new ideas posted on this site")}
- <p>
- {this.icon("event_notification_new_idea", WebChannel)}
- {this.icon("event_notification_new_idea", EmailChannel)}
- </p>
- </div>
- <div className="ui segment">
- <span className="event-title">Discussion</span>
- {this.info(
- "event_notification_new_comment",
- "comments on ideas you've subscribed to",
- "comments on all ideas unless individually unsubscribed"
- )}
- <p>
- {this.icon("event_notification_new_comment", WebChannel)}
- {this.icon("event_notification_new_comment", EmailChannel)}
- </p>
- </div>
- <div className="ui segment">
- <span className="event-title">Status Changed</span>
- {this.info(
- "event_notification_change_status",
- "status change on ideas you've subscribed to",
- "status change on all ideas unless individually unsubscribed"
- )}
- <p>
- {this.icon("event_notification_change_status", WebChannel)}
- {this.icon("event_notification_change_status", EmailChannel)}
- </p>
- </div>
+ <div className="notifications-settings">
+ <Segments>
+ <Segment>
+ <span className="event-title">New Idea</span>
+ {this.info(
+ "event_notification_new_idea",
+ "new ideas posted on this site",
+ "new ideas posted on this site"
+ )}
+ <p>
+ {this.icon("event_notification_new_idea", WebChannel)}
+ {this.icon("event_notification_new_idea", EmailChannel)}
+ </p>
+ </Segment>
+ <Segment>
+ <span className="event-title">Discussion</span>
+ {this.info(
+ "event_notification_new_comment",
+ "comments on ideas you've subscribed to",
+ "comments on all ideas unless individually unsubscribed"
+ )}
+ <p>
+ {this.icon("event_notification_new_comment", WebChannel)}
+ {this.icon("event_notification_new_comment", EmailChannel)}
+ </p>
+ </Segment>
+ <Segment>
+ <span className="event-title">Status Changed</span>
+ {this.info(
+ "event_notification_change_status",
+ "status change on ideas you've subscribed to",
+ "status change on all ideas unless individually unsubscribed"
+ )}
+ <p>
+ {this.icon("event_notification_change_status", WebChannel)}
+ {this.icon("event_notification_change_status", EmailChannel)}
+ </p>
+ </Segment>
+ </Segments>
</div>
</>
);
diff --git a/public/pages/ShowIdea/ShowIdea.page.scss b/public/pages/ShowIdea/ShowIdea.page.scss
index 2d625bd9e..9ee047d10 100644
--- a/public/pages/ShowIdea/ShowIdea.page.scss
+++ b/public/pages/ShowIdea/ShowIdea.page.scss
@@ -12,7 +12,7 @@
font-weight: 400;
margin: 0px;
font-size: $font-size-xlarge;
- @include media("phone") {
+ @include media("sm") {
font-size: $font-size-big;
}
}
@@ -22,7 +22,7 @@
}
}
- @include media(">tablet") {
+ @include media(">=md") {
.header-col,
.comments-col {
float: left;
@@ -35,68 +35,23 @@
.header-col {
margin-bottom: 5px;
+ .c-list-item {
+ display: flex;
+ }
}
.action-col {
- @include media(">tablet") {
+ @include media(">=md") {
width: 200px;
}
- .ui.list {
- margin: 0.5em 0em;
- }
}
- .tag-list {
- .tag-icon {
- width: 10px;
- height: 10px;
- display: inline-block;
- margin-right: 5px;
- border-radius: 50%;
+ .c-tag-list {
+ .icon.check {
+ color: $green;
}
- .selectable {
- &.item {
- margin: 5px 0px;
- }
- i {
- display: inline-block;
- color: $green;
- }
- .ui.circular.label {
- margin-right: 5px;
- }
- cursor: pointer;
- }
- }
-
- .ui.comments {
- .c-avatar {
- margin-right: 5px;
- vertical-align: top;
- margin-top: 2px;
- }
-
- .comment > .content {
- display: inline-block;
- width: 85%;
- }
- }
-
- .comment-input {
- margin-top: 15px;
- textarea {
- margin-top: 5px;
- }
-
- .form {
- display: inline-block;
- width: 100%;
- }
-
- &.authenticated{
- .form {
- width: 85%;
- }
+ span {
+ margin-left: 5px;
}
}
}
@@ -111,7 +66,7 @@
margin: 0;
}
}
- .gm-status-label {
+ .status-label {
width: 60px;
margin-right: 5px;
text-align: center;
diff --git a/public/pages/ShowIdea/ShowIdea.page.tsx b/public/pages/ShowIdea/ShowIdea.page.tsx
index 453a4e3c2..58ea51fd7 100644
--- a/public/pages/ShowIdea/ShowIdea.page.tsx
+++ b/public/pages/ShowIdea/ShowIdea.page.tsx
@@ -11,11 +11,15 @@ import {
ShowIdeaResponse,
DisplayError,
Button,
- Textarea,
UserName,
Gravatar,
Moment,
- MultiLineText
+ MultiLineText,
+ List,
+ ListItem,
+ Input,
+ Form,
+ TextArea
} from "@fider/components";
interface ShowIdeaPageProps {
@@ -63,25 +67,22 @@ export class ShowIdeaPage extends React.Component<ShowIdeaPageProps, ShowIdeaPag
public render() {
return (
- <div id="p-show-idea" className="page ui container">
+ <div id="p-show-idea" className="page container">
<div className="header-col">
- <div className="ui items unstackable">
- <div className="item">
+ <List>
+ <ListItem>
<SupportCounter user={this.props.user} idea={this.props.idea} />
<div className="idea-header">
{this.state.editMode ? (
- [
- <div key={1} className="ui input huge fluid">
- <input
- type="text"
- maxLength={100}
- onChange={e => this.setState({ newTitle: e.currentTarget.value })}
- defaultValue={this.state.newTitle}
- />
- </div>,
- <DisplayError key={0} fields={["title"]} pointing="above" error={this.state.error} />
- ]
+ <Form error={this.state.error}>
+ <Input
+ field="title"
+ maxLength={100}
+ value={this.state.newTitle}
+ onChange={newTitle => this.setState({ newTitle })}
+ />
+ </Form>
) : (
<h1>{this.props.idea.title}</h1>
)}
@@ -91,20 +92,18 @@ export class ShowIdeaPage extends React.Component<ShowIdeaPageProps, ShowIdeaPag
<UserName user={this.props.idea.user} />
</span>
</div>
- </div>
- </div>
+ </ListItem>
+ </List>
<span className="subtitle">Description</span>
{this.state.editMode ? (
- <div className="ui form">
- <div className="field">
- <DisplayError fields={["description"]} error={this.state.error} />
- <Textarea
- onChange={e => this.setState({ newDescription: e.currentTarget.value })}
- defaultValue={this.state.newDescription}
- />
- </div>
- </div>
+ <Form error={this.state.error}>
+ <TextArea
+ field="description"
+ value={this.state.newDescription}
+ onChange={newDescription => this.setState({ newDescription })}
+ />
+ </Form>
) : this.props.idea.description ? (
<MultiLineText className="description" text={this.props.idea.description} style="simple" />
) : (
@@ -121,29 +120,29 @@ export class ShowIdeaPage extends React.Component<ShowIdeaPageProps, ShowIdeaPag
Actions
</span>,
this.state.editMode ? (
- <div key={1} className="ui list">
- <div className="item">
+ <List key={1}>
+ <ListItem>
<Button color="positive" fluid={true} onClick={async () => this.saveChanges()}>
<i className="save icon" /> Save
</Button>
- </div>
- <div className="item">
+ </ListItem>
+ <ListItem>
<Button fluid={true} onClick={async () => this.setState({ error: undefined, editMode: false })}>
<i className="cancel icon" /> Cancel
</Button>
- </div>
- </div>
+ </ListItem>
+ </List>
) : (
- <div key={1} className="ui list">
- <div className="item">
+ <List key={1}>
+ <ListItem>
<Button fluid={true} onClick={async () => this.setState({ editMode: true })}>
<i className="edit icon" /> Edit
</Button>
- </div>
- <div className="item">
+ </ListItem>
+ <ListItem>
<ResponseForm idea={this.props.idea} />
- </div>
- </div>
+ </ListItem>
+ </List>
)
]}
diff --git a/public/pages/ShowIdea/components/CommentInput.tsx b/public/pages/ShowIdea/components/CommentInput.tsx
index bc2446e39..ac8d29c99 100644
--- a/public/pages/ShowIdea/components/CommentInput.tsx
+++ b/public/pages/ShowIdea/components/CommentInput.tsx
@@ -2,7 +2,7 @@ import * as React from "react";
import * as ReactDOM from "react-dom";
import { Idea, CurrentUser } from "@fider/models";
-import { Gravatar, UserName, Button, Textarea, DisplayError, SignInControl } from "@fider/components/common";
+import { Gravatar, UserName, Button, DisplayError, SignInControl, TextArea, Form } from "@fider/components/common";
import { SignInModal } from "@fider/components";
import { cache, page, actions, Failure } from "@fider/services";
@@ -36,9 +36,9 @@ export class CommentInput extends React.Component<CommentInputProps, CommentInpu
return `${CACHE_TITLE_KEY}${this.props.idea.id}`;
}
- private commentChanged = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
- cache.set(this.getCacheKey(), e.currentTarget.value);
- this.setState({ content: e.currentTarget.value });
+ private commentChanged = (content: string) => {
+ cache.set(this.getCacheKey(), content);
+ this.setState({ content });
};
private onTextFocused() {
@@ -68,27 +68,25 @@ export class CommentInput extends React.Component<CommentInputProps, CommentInpu
return (
<>
<SignInModal isOpen={this.state.showSignIn} />
- <div className={`comment-input ${this.props.user && "authenticated"}`}>
+ <div className={`c-comment-input ${this.props.user && "m-authenticated"}`}>
{this.props.user && <Gravatar user={this.props.user} />}
- <div className="ui form">
+ <Form error={this.state.error}>
{this.props.user && <UserName user={this.props.user} />}
- <DisplayError error={this.state.error} />
- <div className="field">
- <Textarea
- onChange={this.commentChanged}
- defaultValue={this.state.content}
- onFocus={() => this.onTextFocused()}
- inputRef={e => (this.input = e!)}
- rows={1}
- placeholder="Write a comment..."
- />
- </div>
+ <TextArea
+ placeholder="Write a comment..."
+ field="content"
+ value={this.state.content}
+ minRows={1}
+ onChange={this.commentChanged}
+ onFocus={() => this.onTextFocused()}
+ inputRef={e => (this.input = e!)}
+ />
{this.state.content && (
<Button color="positive" onClick={() => this.submit()}>
Submit
</Button>
)}
- </div>
+ </Form>
</div>
</>
);
diff --git a/public/pages/ShowIdea/components/CommentList.tsx b/public/pages/ShowIdea/components/CommentList.tsx
index 2780b3711..9dd5869a4 100644
--- a/public/pages/ShowIdea/components/CommentList.tsx
+++ b/public/pages/ShowIdea/components/CommentList.tsx
@@ -1,7 +1,7 @@
import * as React from "react";
import { Idea, Comment, CurrentUser } from "@fider/models";
import { Failure, actions, formatDate } from "@fider/services";
-import { DisplayError, Textarea, Button, UserName, Gravatar, Moment, MultiLineText } from "@fider/components/common";
+import { DisplayError, Button, UserName, Gravatar, Moment, MultiLineText, TextArea, Form } from "@fider/components";
interface CommentListProps {
idea: Idea;
@@ -77,16 +77,16 @@ export class CommentList extends React.Component<CommentListProps, CommentListSt
public render() {
return this.props.comments.map(c => {
return (
- <div key={c.id} className="comment">
+ <div key={c.id} className="c-comment">
<Gravatar user={c.user} />
- <div className="content">
+ <div className="c-comment-content">
<UserName user={c.user} />
- <div className="metadata">
+ <div className="c-comment-metadata">
· <Moment date={c.createdOn} />
</div>
{!!c.editedOn &&
!!c.editedBy && (
- <div className="metadata">
+ <div className="c-comment-metadata">
·{" "}
<span title={`This comment has been edited by ${c.editedBy!.name} on ${formatDate(c.editedOn)}`}>
edited
@@ -94,36 +94,34 @@ export class CommentList extends React.Component<CommentListProps, CommentListSt
</div>
)}
{this.canEditComment(c) && (
- <div className="metadata">
+ <div className="c-comment-metadata">
·{" "}
<span className="clickable" onClick={() => this.startEdit(c)}>
edit
</span>
</div>
)}
- <div className="text">
+ <div className="c-comment-text">
{c === this.state.editingComment ? (
- <div className="ui form">
- <DisplayError error={this.state.error} />
- <div className="field">
- <Textarea
- rows={1}
- defaultValue={c.content}
- placeholder={c.content}
- onChange={e =>
- this.setState({
- editCommentNewContent: e.currentTarget.value
- })
- }
- />
- </div>
+ <Form error={this.state.error}>
+ <TextArea
+ field="content"
+ minRows={1}
+ value={this.state.editCommentNewContent}
+ placeholder={c.content}
+ onChange={editCommentNewContent =>
+ this.setState({
+ editCommentNewContent
+ })
+ }
+ />
<Button size="tiny" onClick={() => this.confirmEdit()} color="positive">
Save
</Button>
<Button size="tiny" onClick={() => this.cancelEdit()}>
Cancel
</Button>
- </div>
+ </Form>
) : (
<MultiLineText text={c.content} style="simple" />
)}
diff --git a/public/pages/ShowIdea/components/Comments.scss b/public/pages/ShowIdea/components/Comments.scss
new file mode 100644
index 000000000..dcf28326d
--- /dev/null
+++ b/public/pages/ShowIdea/components/Comments.scss
@@ -0,0 +1,54 @@
+@import '~@fider/assets/styles/variables.scss';
+
+.c-comment-list {
+ max-width: 650px;
+
+ .c-avatar {
+ margin-right: 5px;
+ vertical-align: top;
+ margin-top: 2px;
+ }
+
+ .c-comment {
+ position: relative;
+ margin: 0 0 15px 0;
+ border: none;
+ border-top: none;
+ line-height: 1.2;
+
+ .c-comment-content {
+ display: inline-block;
+ width: 85%;
+
+ .c-comment-text {
+ margin-top: 2px;
+ }
+
+ .c-comment-metadata {
+ display: inline-block;
+ margin-left: .5em;
+ font-size: 80%;
+ color: $gray-darker;
+ }
+ }
+ }
+}
+
+.c-comment-input {
+ margin: 0 0 15px 0;
+
+ .c-form {
+ margin-top: 5px;
+ display: inline-block;
+ width: 100%;
+ textarea {
+ margin-top: 5px;
+ }
+ }
+
+ &.m-authenticated{
+ .c-form {
+ width: 85%;
+ }
+ }
+}
\ No newline at end of file
diff --git a/public/pages/ShowIdea/components/DiscussionPanel.tsx b/public/pages/ShowIdea/components/DiscussionPanel.tsx
index aa77a06c4..87355f7a4 100644
--- a/public/pages/ShowIdea/components/DiscussionPanel.tsx
+++ b/public/pages/ShowIdea/components/DiscussionPanel.tsx
@@ -1,3 +1,5 @@
+import "./Comments.scss";
+
import * as React from "react";
import { CurrentUser, Comment, Idea } from "@fider/models";
import { CommentList, CommentInput } from "../";
@@ -24,7 +26,7 @@ export class DiscussionPanel extends React.Component<DiscussionPanelProps, Discu
public render() {
return (
<div className="comments-col">
- <div className="ui comments">
+ <div className="c-comment-list">
<span className="subtitle">Discussion</span>
<CommentList
idea={this.props.idea}
diff --git a/public/pages/ShowIdea/components/IdeaSearch.tsx b/public/pages/ShowIdea/components/IdeaSearch.tsx
index bbf599b39..008ff7089 100644
--- a/public/pages/ShowIdea/components/IdeaSearch.tsx
+++ b/public/pages/ShowIdea/components/IdeaSearch.tsx
@@ -59,7 +59,7 @@ export class IdeaSearch extends React.Component<IdeaSearchProps, IdeaSearchState
<i className="medium caret up icon" />
{i.totalSupporters}
</span>
- <span className={`gm-status-label gm-status-${status.slug}`}>{status.title}</span>
+ <span className={`status-label status-${status.slug}`}>{status.title}</span>
{i.title}
</>
)
diff --git a/public/pages/ShowIdea/components/ModerationPanel.tsx b/public/pages/ShowIdea/components/ModerationPanel.tsx
index 70a81fb90..227d9da68 100644
--- a/public/pages/ShowIdea/components/ModerationPanel.tsx
+++ b/public/pages/ShowIdea/components/ModerationPanel.tsx
@@ -1,7 +1,7 @@
import * as React from "react";
import { IdeaStatus, CurrentUser, Idea } from "@fider/models";
import { page, actions, Failure } from "@fider/services";
-import { Form, DisplayError, Textarea, Modal, Button } from "@fider/components";
+import { Form, DisplayError, Modal, Button, List, ListItem, TextArea } from "@fider/components";
interface ModerationPanelProps {
user?: CurrentUser;
@@ -11,6 +11,7 @@ interface ModerationPanelProps {
interface ModerationPanelState {
showConfirmation: boolean;
text: string;
+ error?: Failure;
}
export class ModerationPanel extends React.Component<ModerationPanelProps, ModerationPanelState> {
@@ -30,7 +31,7 @@ export class ModerationPanel extends React.Component<ModerationPanelProps, Moder
this.close();
page.goHome();
} else if (response.error) {
- this.form.setFailure(response.error);
+ this.setState({ error: this.state.error });
}
}
@@ -47,21 +48,17 @@ export class ModerationPanel extends React.Component<ModerationPanelProps, Moder
const modal = (
<Modal.Window isOpen={this.state.showConfirmation} center={false} size="large">
<Modal.Content>
- <Form
- ref={f => {
- this.form = f!;
- }}
- >
- <div className="field">
- <Textarea
- onChange={e => this.setState({ text: e.currentTarget.value })}
- defaultValue={this.state.text}
- placeholder="Why are you deleting this idea? (optional)"
- />
- </div>
- <span className="info">
- This operation <strong>cannot</strong> be undone.
- </span>
+ <Form error={this.state.error}>
+ <TextArea
+ field="text"
+ onChange={text => this.setState({ text })}
+ value={this.state.text}
+ placeholder="Why are you deleting this idea? (optional)"
+ >
+ <span className="info">
+ This operation <strong>cannot</strong> be undone.
+ </span>
+ </TextArea>
</Form>
</Modal.Content>
@@ -78,8 +75,8 @@ export class ModerationPanel extends React.Component<ModerationPanelProps, Moder
<div>
{modal}
<span className="subtitle">Moderation</span>
- <div className="ui list">
- <div className="item">
+ <List>
+ <ListItem>
<Button
color="danger"
size="tiny"
@@ -88,8 +85,8 @@ export class ModerationPanel extends React.Component<ModerationPanelProps, Moder
>
<i className="delete icon" /> Delete
</Button>
- </div>
- </div>
+ </ListItem>
+ </List>
</div>
);
}
diff --git a/public/pages/ShowIdea/components/NotificationsPanel.tsx b/public/pages/ShowIdea/components/NotificationsPanel.tsx
index c0ab53a54..f91d76c2a 100644
--- a/public/pages/ShowIdea/components/NotificationsPanel.tsx
+++ b/public/pages/ShowIdea/components/NotificationsPanel.tsx
@@ -1,6 +1,6 @@
import * as React from "react";
import { CurrentUser, Idea } from "@fider/models";
-import { Button } from "@fider/components/common";
+import { Button, List, ListItem } from "@fider/components";
import { actions } from "@fider/services";
interface NotificationsPanelProps {
@@ -54,12 +54,12 @@ export class NotificationsPanel extends React.Component<NotificationsPanelProps,
return (
<>
<span className="subtitle">Notifications</span>
- <div className="ui list">
- <div className="item">
+ <List>
+ <ListItem>
{button}
{text}
- </div>
- </div>
+ </ListItem>
+ </List>
</>
);
}
diff --git a/public/pages/ShowIdea/components/ResponseForm.tsx b/public/pages/ShowIdea/components/ResponseForm.tsx
index 6de5eea0c..fa3fcba02 100644
--- a/public/pages/ShowIdea/components/ResponseForm.tsx
+++ b/public/pages/ShowIdea/components/ResponseForm.tsx
@@ -1,6 +1,6 @@
import * as React from "react";
-import { Modal, Button, DisplayError, Textarea } from "@fider/components/common";
+import { Modal, Button, DisplayError, Textarea, Select, Form, TextArea, Field } from "@fider/components";
import { Comment, Idea, IdeaStatus, User } from "@fider/models";
import { IdeaSearch } from "../";
@@ -19,8 +19,6 @@ interface ResponseFormState {
}
export class ResponseForm extends React.Component<ResponseFormProps, ResponseFormState> {
- private modal!: HTMLDivElement;
-
constructor(props: ResponseFormProps) {
super(props);
@@ -28,7 +26,7 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
showModal: false,
status: this.props.idea.status,
originalNumber: 0,
- text: this.props.idea.response && this.props.idea.response.text
+ text: this.props.idea.response ? this.props.idea.response.text : ""
};
}
@@ -50,53 +48,43 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
</Button>
);
+ const options = IdeaStatus.All.map(s => ({
+ value: s.value.toString(),
+ label: s.title
+ }));
+
const modal = (
<Modal.Window isOpen={this.state.showModal} center={false} size="large">
<Modal.Content>
- <div className="ui form c-response-form">
- <DisplayError fields={["status"]} error={this.state.error} />
- <div className="two fields">
- <div className="field">
- <label>Status</label>
- <select
- className="ui dropdown"
- defaultValue={this.props.idea.status.toString()}
- onChange={e =>
- this.setState({
- status: parseInt(e.currentTarget.value, 10)
- })
- }
- >
- {IdeaStatus.All.map(s => (
- <option key={s.value} value={s.value.toString()}>
- {s.title}
- </option>
- ))}
- </select>
- </div>
- </div>
+ <Form error={this.state.error} className="c-response-form">
+ <Select
+ field="status"
+ label="Status"
+ defaultValue={this.props.idea.status.toString()}
+ options={options}
+ onChange={opt => opt && this.setState({ status: parseInt(opt.value, 10) })}
+ />
{this.state.status === IdeaStatus.Duplicate.value ? (
<>
+ <Field>
+ <IdeaSearch
+ exclude={[this.props.idea.number]}
+ onChanged={originalNumber => this.setState({ originalNumber })}
+ />
+ </Field>
<DisplayError fields={["originalNumber"]} error={this.state.error} />
- <IdeaSearch
- exclude={[this.props.idea.number]}
- onChanged={originalNumber => this.setState({ originalNumber })}
- />
<span className="info">Votes from this idea will be merged into original idea.</span>
</>
) : (
- <>
- <DisplayError fields={["text"]} error={this.state.error} />
- <div className="field">
- <Textarea
- onChange={e => this.setState({ text: e.currentTarget.value })}
- defaultValue={this.state.text}
- placeholder="What's going on with this idea? Let your users know what are your plans..."
- />
- </div>
- </>
+ <TextArea
+ field="text"
+ onChange={text => this.setState({ text })}
+ value={this.state.text}
+ minRows={5}
+ placeholder="What's going on with this idea? Let your users know what are your plans..."
+ />
)}
- </div>
+ </Form>
</Modal.Content>
<Modal.Footer>
diff --git a/public/pages/ShowIdea/components/TagsPanel.tsx b/public/pages/ShowIdea/components/TagsPanel.tsx
index 7acef62c2..6f51bd5e1 100644
--- a/public/pages/ShowIdea/components/TagsPanel.tsx
+++ b/public/pages/ShowIdea/components/TagsPanel.tsx
@@ -1,7 +1,7 @@
import * as React from "react";
import { CurrentUser, Tag, Idea } from "@fider/models";
import { actions } from "@fider/services";
-import { ShowTag } from "@fider/components";
+import { ShowTag, List, ListItem } from "@fider/components";
interface TagsPanelProps {
user?: CurrentUser;
@@ -58,30 +58,30 @@ export class TagsPanel extends React.Component<TagsPanelProps, TagsPanelState> {
const tagsList =
this.state.assignedTags.length > 0 ? (
- <div className="ui list tag-list">
+ <List className="c-tag-list">
{this.state.assignedTags.map(tag => (
- <div key={tag.id} className="item">
+ <ListItem key={tag.id}>
<ShowTag tag={tag} size="mini" />
- </div>
+ </ListItem>
))}
- </div>
+ </List>
) : (
<span className="info">None yet</span>
);
const editTagsList = this.props.tags.length > 0 && (
- <div className="ui list tag-list">
+ <List className="c-tag-list">
{this.props.tags.map(tag => (
- <div key={tag.id} className="item selectable" onClick={async () => this.assignOrUnassignTag(tag)}>
+ <ListItem key={tag.id} onClick={async () => this.assignOrUnassignTag(tag)}>
<i className={`icon ${this.state.assignedTags.indexOf(tag) >= 0 && "check"}`} />
- <ShowTag tag={tag} circular={true} />
+ <ShowTag tag={tag} size="mini" circular={true} />
<span>{tag.name}</span>
- </div>
+ </ListItem>
))}
- </div>
+ </List>
);
- const subtitleClasses = `subtitle ${this.state.canEdit && "active gm-primary-hover"}`;
+ const subtitleClasses = `subtitle ${this.state.canEdit && "active"}`;
const icon =
this.state.canEdit &&
(this.state.isEditing ? <i className="check circle icon" /> : <i className="setting icon" />);
diff --git a/public/pages/SignIn/SignIn.page.tsx b/public/pages/SignIn/SignIn.page.tsx
index e24d1cd71..70e471410 100644
--- a/public/pages/SignIn/SignIn.page.tsx
+++ b/public/pages/SignIn/SignIn.page.tsx
@@ -25,7 +25,7 @@ export class SignInPage extends React.Component<SignInPageProps, {}> {
public render() {
return (
- <div id="p-signin" className="page ui container">
+ <div id="p-signin" className="page container">
<div className="message">
<Logo size={100} tenant={this.props.tenant} />
<p className="welcome">
diff --git a/public/pages/SignUp/SignUp.page.tsx b/public/pages/SignUp/SignUp.page.tsx
index 182d3362f..4aceca204 100644
--- a/public/pages/SignUp/SignUp.page.tsx
+++ b/public/pages/SignUp/SignUp.page.tsx
@@ -1,7 +1,7 @@
import "./SignUp.page.scss";
import * as React from "react";
-import { SignInControl, Modal, Button, DisplayError } from "@fider/components/common";
+import { SignInControl, Modal, Button, DisplayError, Form, Input, Message } from "@fider/components";
import { SystemSettings } from "@fider/models";
import { jwt, page, actions, Failure } from "@fider/services";
@@ -109,11 +109,11 @@ export class SignUpPage extends React.Component<SignUpPageProps, SignUpPageState
);
return (
- <div id="p-signup" className="page ui container">
+ <div id="p-signup" className="page container">
{modal}
<img className="logo" src={logo} />
- <h3 className="ui header">1. Who are you?</h3>
+ <h3>1. Who are you?</h3>
<DisplayError fields={["token"]} error={this.state.error} />
{this.user ? (
@@ -124,67 +124,42 @@ export class SignUpPage extends React.Component<SignUpPageProps, SignUpPageState
<>
<p>We need to identify you to setup your new Fider account.</p>
<SignInControl useEmail={false} />
- <div className="ui form">
- <DisplayError fields={["name", "email"]} error={this.state.error} />
- <div className="fluid field">
- <input
- id="name"
- onChange={e => this.setState({ name: e.currentTarget.value })}
- type="text"
- placeholder="your name"
- className="small"
- />
- </div>
- <div className="fluid field">
- <input
- id="email"
- onChange={e => this.setState({ email: e.currentTarget.value })}
- type="text"
- placeholder="[email protected]"
- className="small"
- />
- </div>
- </div>
+ <Form error={this.state.error}>
+ <Input field="name" maxLength={100} onChange={name => this.setState({ name })} placeholder="your name" />
+ <Input
+ field="email"
+ maxLength={200}
+ onChange={email => this.setState({ email })}
+ placeholder="[email protected]"
+ />
+ </Form>
</>
)}
- <div className="ui section divider" />
-
- <h3 className="ui header">2. What is this Feedback Forum for?</h3>
-
- <DisplayError fields={["tenantName", "subdomain"]} error={this.state.error} />
- <div className="ui form">
- <div className="fluid field">
- <input
- id="tenantName"
- type="text"
- placeholder="your company or product name"
- maxLength={60}
- onChange={e => this.setState({ tenantName: e.currentTarget.value })}
- />
- </div>
+ <h3>2. What is this Feedback Forum for?</h3>
+
+ <Form error={this.state.error}>
+ <Input
+ field="tenantName"
+ maxLength={60}
+ onChange={tenantName => this.setState({ tenantName })}
+ placeholder="your company or product name"
+ />
{!page.isSingleHostMode() && (
- <div className="fluid field">
- <div className="ui right labeled input">
- <input
- id="subdomain"
- type="text"
- maxLength={40}
- placeholder="subdomain"
- onChange={e => this.checkAvailability(e.currentTarget.value)}
- />
- <div className="ui label">{this.props.system.domain}</div>
- {this.state.subdomain.available && <div className="ui left pointing green basic label">Great!</div>}
- {this.state.subdomain.message && (
- <div className="ui left pointing red basic label">{this.state.subdomain.message}</div>
- )}
- </div>
- </div>
+ <Input
+ field="subdomain"
+ maxLength={40}
+ onChange={subdomain => this.checkAvailability(subdomain)}
+ placeholder="subdomain"
+ suffix={this.props.system.domain}
+ >
+ {this.state.subdomain.available && <Message type="success">This subdomain is available!</Message>}
+ {this.state.subdomain.message && <Message type="error">{this.state.subdomain.message}</Message>}
+ </Input>
)}
- </div>
- <div className="ui section divider" />
+ </Form>
- <h3 className="ui header">3. Review and continue</h3>
+ <h3>3. Review and continue</h3>
<p>Make sure information provided above is correct before proceeding.</p>
diff --git a/public/pages/UI/UIToolkit.page.tsx b/public/pages/UI/UIToolkit.page.tsx
new file mode 100644
index 000000000..bbdae3588
--- /dev/null
+++ b/public/pages/UI/UIToolkit.page.tsx
@@ -0,0 +1,345 @@
+import * as React from "react";
+import { CurrentUser, IdeaStatus } from "@fider/models";
+import {
+ Heading,
+ Button,
+ List,
+ UserName,
+ ListItem,
+ Toggle,
+ Gravatar,
+ ShowTag,
+ Segment,
+ Segments,
+ ShowIdeaStatus,
+ Moment,
+ Loader,
+ Form,
+ Input,
+ TextArea,
+ RadioButton,
+ Select,
+ SocialSignInButton
+} from "@fider/components";
+import { User, UserRole, Tag } from "@fider/models";
+import { notify, Failure } from "@fider/services";
+
+const jonSnow: User = {
+ id: 0,
+ name: "Jon Snow",
+ role: UserRole.Administrator
+};
+
+const aryaStark: User = {
+ id: 0,
+ name: "Arya Snow",
+ role: UserRole.Visitor
+};
+
+const easyTag: Tag = { id: 2, slug: "easy", name: "Easy", color: "00a3a5", isPublic: true };
+const hardTag: Tag = { id: 3, slug: "hard", name: "Hard", color: "ad43ec", isPublic: false };
+
+const visibilityPublic = { label: "Public", value: "public" };
+const visibilityPrivate = { label: "Private", value: "private" };
+
+interface UIToolkitPageState {
+ error?: Failure;
+}
+
+export class UIToolkitPage extends React.Component<{}, UIToolkitPageState> {
+ constructor(props: {}) {
+ super(props);
+ this.state = {};
+ }
+
+ public render() {
+ return (
+ <div id="p-ui-toolkit" className="page container">
+ <h1>Heading 1</h1>
+ <h2>Heading 2</h2>
+ <h3>Heading 3</h3>
+ <h4>Heading 4</h4>
+ <h5>Heading 5</h5>
+ <p>General Text Paragraph</p>
+ <p className="info">Info Text</p>
+
+ <Segment>
+ <h2>The title</h2>
+ <p>The content goes here</p>
+ </Segment>
+
+ <Segments>
+ <Segment>
+ <p>First Segment</p>
+ </Segment>
+ <Segment>
+ <p>Second Segment</p>
+ </Segment>
+ <Segment>
+ <p>Third Segment</p>
+ </Segment>
+ </Segments>
+
+ <List>
+ <ListItem>
+ <Gravatar user={jonSnow} /> <UserName user={jonSnow} />
+ </ListItem>
+ <ListItem>
+ <Gravatar user={aryaStark} /> <UserName user={aryaStark} />
+ </ListItem>
+ </List>
+
+ <Heading title="Page Heading" icon="settings" subtitle="This is a page heading" />
+
+ <Heading title="Section Heading" icon="lightbulb" subtitle="This is a page heading" level={3} dividing={true} />
+
+ <h1>Buttons</h1>
+ <List>
+ <ListItem>
+ <Button size="large">Large Default</Button>
+ <Button color="positive" size="large">
+ Large Positive
+ </Button>
+ <Button color="danger" size="large">
+ Large Danger
+ </Button>
+ </ListItem>
+
+ <ListItem>
+ <Button size="normal">Normal Default</Button>
+ <Button color="positive" size="normal">
+ Normal Positive
+ </Button>
+ <Button color="danger" size="normal">
+ Normal Danger
+ </Button>
+ </ListItem>
+
+ <ListItem>
+ <Button size="small">Small Default</Button>
+ <Button color="positive" size="small">
+ Small Positive
+ </Button>
+ <Button color="danger" size="small">
+ Small Danger
+ </Button>
+ </ListItem>
+
+ <ListItem>
+ <Button size="tiny">Tiny Default</Button>
+ <Button color="positive" size="tiny">
+ Tiny Positive
+ </Button>
+ <Button color="danger" size="tiny">
+ Tiny Danger
+ </Button>
+ </ListItem>
+
+ <ListItem>
+ <Button size="mini">Mini Default</Button>
+ <Button color="positive" size="mini">
+ Mini Positive
+ </Button>
+ <Button color="danger" size="mini">
+ Mini Danger
+ </Button>
+ </ListItem>
+
+ <ListItem>
+ <Button href="#">Link</Button>
+ <Button href="#" color="positive">
+ Link
+ </Button>
+ <Button href="#" color="danger">
+ Link
+ </Button>
+ </ListItem>
+
+ <ListItem>
+ <Button disabled={true}>Default</Button>
+ <Button disabled={true} color="positive">
+ Positive
+ </Button>
+ <Button disabled={true} color="danger">
+ Danger
+ </Button>
+ </ListItem>
+ </List>
+
+ <h1>Social Buttons</h1>
+ <div className="row">
+ <div className="col-md-3">
+ <SocialSignInButton provider="google" />
+ </div>
+ <div className="col-md-3">
+ <SocialSignInButton provider="facebook" />
+ </div>
+ <div className="col-md-3">
+ <SocialSignInButton provider="github" />
+ </div>
+ </div>
+
+ <h1>Toggle</h1>
+ <List>
+ <ListItem>
+ <Toggle active={true} label="Active" />
+ </ListItem>
+ <ListItem>
+ <Toggle active={false} label="Inactive" />
+ </ListItem>
+ <ListItem>
+ <Toggle active={true} disabled={true} label="Disabled" />
+ </ListItem>
+ </List>
+
+ <h1>Statuses</h1>
+ <List>
+ <ListItem>
+ <ShowIdeaStatus status={IdeaStatus.Open} />
+ </ListItem>
+ <ListItem>
+ <ShowIdeaStatus status={IdeaStatus.Planned} />
+ </ListItem>
+ <ListItem>
+ <ShowIdeaStatus status={IdeaStatus.Started} />
+ </ListItem>
+ <ListItem>
+ <ShowIdeaStatus status={IdeaStatus.Duplicate} />
+ </ListItem>
+ <ListItem>
+ <ShowIdeaStatus status={IdeaStatus.Completed} />
+ </ListItem>
+ <ListItem>
+ <ShowIdeaStatus status={IdeaStatus.Declined} />
+ </ListItem>
+ </List>
+
+ <h1>Tags</h1>
+ <List>
+ <ListItem>
+ <ShowTag tag={easyTag} size="large" />
+ <ShowTag tag={hardTag} size="large" />
+ <ShowTag tag={easyTag} circular={true} size="large" />
+ <ShowTag tag={hardTag} circular={true} size="large" />
+ </ListItem>
+ <ListItem>
+ <ShowTag tag={easyTag} size="normal" />
+ <ShowTag tag={hardTag} size="normal" />
+ <ShowTag tag={easyTag} circular={true} size="normal" />
+ <ShowTag tag={hardTag} circular={true} size="normal" />
+ </ListItem>
+ <ListItem>
+ <ShowTag tag={easyTag} size="small" />
+ <ShowTag tag={hardTag} size="small" />
+ <ShowTag tag={easyTag} circular={true} size="small" />
+ <ShowTag tag={hardTag} circular={true} size="small" />
+ </ListItem>
+ <ListItem>
+ <ShowTag tag={easyTag} size="tiny" />
+ <ShowTag tag={hardTag} size="tiny" />
+ <ShowTag tag={easyTag} circular={true} size="tiny" />
+ <ShowTag tag={hardTag} circular={true} size="tiny" />
+ </ListItem>
+ <ListItem>
+ <ShowTag tag={easyTag} size="mini" />
+ <ShowTag tag={hardTag} size="mini" />
+ <ShowTag tag={easyTag} circular={true} size="mini" />
+ <ShowTag tag={hardTag} circular={true} size="mini" />
+ </ListItem>
+ </List>
+
+ <h1>Notification</h1>
+ <List>
+ <ListItem>
+ <Button onClick={async () => notify.success("Congratulations! It worked!")}>Success</Button>
+ <Button onClick={async () => notify.error("Something went wrong...")}>Error</Button>
+ </ListItem>
+ </List>
+
+ <h1>Moment</h1>
+ <List>
+ <ListItem>
+ <Moment date="2017-06-03T16:55:06.815042Z" />
+ </ListItem>
+ <ListItem>
+ <Moment date={new Date(2014, 10, 3, 12, 53, 12, 0)} />
+ </ListItem>
+ <ListItem>
+ <Moment date={new Date()} />
+ </ListItem>
+ </List>
+
+ <h1>Loader</h1>
+ <Loader />
+
+ <h1>Form</h1>
+ <Form error={this.state.error}>
+ <Input label="Title" field="title">
+ <p className="info">This is the explanation for the field above.</p>
+ </Input>
+ <Input label="Disabled!" field="unamed" disabled={true} value={"you can't change this!"} />
+ <Input label="Name" field="name" placeholder={"Your name goes here..."} />
+ <Input label="Subdomain" field="subdomain" suffix="fider.io" />
+ <Input label="Email" field="email" suffix={<Button color="positive">Sign in</Button>} />
+ <TextArea label="Description" field="description" minRows={5}>
+ <p className="info">This textarea resizes as you type.</p>
+ </TextArea>
+ <Input field="age" placeholder="This field doesn't have a label" />
+
+ <div className="row">
+ <div className="col-md-3">
+ <Input label="Title1" field="title1" />
+ </div>
+ <div className="col-md-3">
+ <Input label="Title2" field="title2" />
+ </div>
+ <div className="col-md-3">
+ <Input label="Title3" field="title3" />
+ </div>
+ <div className="col-md-3">
+ <RadioButton
+ label="Visibility"
+ field="visibility"
+ defaultOption={visibilityPublic}
+ options={[visibilityPrivate, visibilityPublic]}
+ />
+ </div>
+ </div>
+
+ <Select
+ label="Status"
+ field="status"
+ options={[
+ { value: "open", label: "Open" },
+ { value: "started", label: "Started" },
+ { value: "planned", label: "Planned" }
+ ]}
+ onChange={opt => opt && notify.success(opt.value)}
+ />
+
+ <Button
+ onClick={async e =>
+ this.setState({
+ error: {
+ messages: [],
+ failures: {
+ title: ["Title is mandatory"],
+ description: ["Error #1", "Error #2"],
+ status: ["Status is mandatory"]
+ }
+ }
+ })
+ }
+ >
+ Save
+ </Button>
+ </Form>
+
+ <Segment>
+ <h1>Search</h1>
+ <Input field="search" placeholder="Search..." icon="search" />
+ </Segment>
+ </div>
+ );
+ }
+}
diff --git a/public/pages/UI/index.ts b/public/pages/UI/index.ts
new file mode 100644
index 000000000..a63cf2b80
--- /dev/null
+++ b/public/pages/UI/index.ts
@@ -0,0 +1 @@
+export * from "./UIToolkit.page";
diff --git a/public/pages/index.ts b/public/pages/index.ts
index 46c828e57..7a5d859e0 100644
--- a/public/pages/index.ts
+++ b/public/pages/index.ts
@@ -6,3 +6,4 @@ export * from "./CompleteSignInProfile";
export * from "./MySettings";
export * from "./MyNotifications";
export * from "./ShowIdea";
+export * from "./UI";
diff --git a/public/router.tsx b/public/router.tsx
index 1db667ed5..46eaa16e7 100644
--- a/public/router.tsx
+++ b/public/router.tsx
@@ -10,10 +10,12 @@ import {
InvitationsPage,
ExportPage,
GeneralSettingsPage,
+ AdvancedSettingsPage,
ManageTagsPage,
ShowIdeaPage,
MySettingsPage,
- MyNotificationsPage
+ MyNotificationsPage,
+ UIToolkitPage
} from "@fider/pages";
interface PageConfiguration {
@@ -40,13 +42,15 @@ const pathRegex = [
route("/admin/privacy", PrivacySettingsPage),
route("/admin/export", ExportPage),
route("/admin/invitations", InvitationsPage),
+ route("/admin/advanced", AdvancedSettingsPage),
route("/admin", GeneralSettingsPage),
route("/signin", SignInPage, false),
route("/signup", SignUpPage, false),
route("/signin/verify", CompleteSignInProfilePage),
route("/invite/verify", CompleteSignInProfilePage),
route("/notifications", MyNotificationsPage),
- route("/settings", MySettingsPage)
+ route("/settings", MySettingsPage),
+ route("/-/ui", UIToolkitPage)
];
export const resolveRootComponent = (path: string): PageConfiguration => {
diff --git a/public/services/actions/tenant.ts b/public/services/actions/tenant.ts
index 2540ab49d..073f1f7b0 100644
--- a/public/services/actions/tenant.ts
+++ b/public/services/actions/tenant.ts
@@ -39,6 +39,10 @@ export const updateTenantSettings = async (request: UpdateTenantSettingsRequest)
return await http.post("/api/admin/settings/general", request);
};
+export const updateTenantAdvancedSettings = async (customCSS: string): Promise<Result> => {
+ return await http.post("/api/admin/settings/advanced", { customCSS });
+};
+
export const updateTenantPrivacy = async (isPrivate: boolean): Promise<Result> => {
return await http.post("/api/admin/settings/privacy", {
isPrivate
diff --git a/public/services/http.ts b/public/services/http.ts
index 1e15b1501..5f5b24f07 100644
--- a/public/services/http.ts
+++ b/public/services/http.ts
@@ -1,8 +1,8 @@
import { analytics } from "@fider/services";
export interface Failure {
- messages: string[];
- failures: {
+ messages?: string[];
+ failures?: {
[key: string]: string[];
};
}
diff --git a/public/services/utils.spec.ts b/public/services/utils.spec.ts
index 4bcf64a39..0e0fec4f2 100644
--- a/public/services/utils.spec.ts
+++ b/public/services/utils.spec.ts
@@ -9,7 +9,16 @@ import { readFileSync } from "fs";
{ input: { disabled: false, green: false }, expected: "" },
{ input: { disabled: true, green: true }, expected: "disabled green" },
{ input: { "ui button": true, green: true }, expected: "ui button green" },
- { input: { "ui button": true }, expected: "ui button" }
+ { input: { "ui button": true }, expected: "ui button" },
+ { input: { "": true }, expected: "" },
+ {
+ input: {
+ green: () => {
+ throw Error();
+ }
+ },
+ expected: "green"
+ }
].forEach(x => {
test(`classSet of ${JSON.stringify(x.input)} should be ${x.expected}`, () => {
const className = classSet(x.input);
diff --git a/public/tsd.d.ts b/public/tsd.d.ts
index 36ecb54b9..1d8283044 100644
--- a/public/tsd.d.ts
+++ b/public/tsd.d.ts
@@ -1,5 +1,18 @@
-interface Window {
- ga?: (cmd: string, evt: string, args?: any) => void;
+import { CurrentUser, SystemSettings, Tenant } from "@fider/models";
+
+interface PageProps {
+ user?: CurrentUser;
+ system: SystemSettings;
+ tenant: Tenant;
+ [key: string]: any;
+}
+
+declare global {
+ interface Window {
+ ga?: (cmd: string, evt: string, args?: any) => void;
+ props: PageProps;
+ set: (key: string, value: any) => void;
+ }
}
declare var require: (id: string) => any;
diff --git a/tests/components/IdeaList.ts b/tests/components/IdeaList.ts
index ede9a4805..774deca4d 100644
--- a/tests/components/IdeaList.ts
+++ b/tests/components/IdeaList.ts
@@ -9,7 +9,7 @@ export class IdeaList {
}
public async navigateAndWait(index: number, condition: WaitCondition) {
- await (await this.elements)[index].findElement(By.css("a.title")).click();
+ await (await this.elements)[index].findElement(By.css(".c-list-item-title")).click();
await this.browser.wait(condition);
}
diff --git a/tests/lib/browser.ts b/tests/lib/browser.ts
index 66b5dc6a2..f03cf885a 100644
--- a/tests/lib/browser.ts
+++ b/tests/lib/browser.ts
@@ -9,7 +9,7 @@ export class Browser {
this.driver
.manage()
.timeouts()
- .implicitlyWait(2000);
+ .implicitlyWait(1000);
}
public async navigate(url: string): Promise<void> {
diff --git a/tests/pages/AdminSettingsPage.ts b/tests/pages/AdminSettingsPage.ts
index feafcb070..ed28aa5bc 100644
--- a/tests/pages/AdminSettingsPage.ts
+++ b/tests/pages/AdminSettingsPage.ts
@@ -21,10 +21,10 @@ export class AdminSettingsPage extends Page {
return `http://${tenant}.dev.fider.io:3000/admin`;
}
- @findBy("#title") public TitleInput!: TextInput;
- @findBy("#welcome-message") public WelcomeMessageInput!: TextInput;
- @findBy("#invitation") public InvitationInput!: TextInput;
- @findBy("button.green") public ConfirmButton!: Button;
+ @findBy("#p-admin-general #input-title") public TitleInput!: TextInput;
+ @findBy("#p-admin-general #input-welcomeMessage") public WelcomeMessageInput!: TextInput;
+ @findBy("#p-admin-general #input-invitation") public InvitationInput!: TextInput;
+ @findBy("#p-admin-general .c-button.m-positive") public ConfirmButton!: Button;
public loadCondition() {
return elementIsVisible(() => this.TitleInput);
diff --git a/tests/pages/HomePage.ts b/tests/pages/HomePage.ts
index 8cada9127..e49563c0e 100644
--- a/tests/pages/HomePage.ts
+++ b/tests/pages/HomePage.ts
@@ -25,23 +25,22 @@ export class HomePage extends Page {
return `http://${tenant}.dev.fider.io:3000/`;
}
- @findBy(".menu a.header") public MenuTitle!: WebComponent;
- @findBy(".page .welcome-message") public WelcomeMessage!: WebComponent;
- @findBy("#new-idea-input") public IdeaTitle!: TextInput;
- @findBy(".ui.form textarea") public IdeaDescription!: TextInput;
- @findBy(".c-button.green") public SubmitIdea!: Button;
- @findBy(".signin") public UserMenu!: WebComponent;
- @findBy(".signin .name") public UserName!: WebComponent;
- @findBy(".c-modal__window") public SignInModal!: WebComponent;
- @findBy(".c-modal__window .c-button.google") public GoogleSignIn!: Button;
- @findBy(".c-modal__window .c-button.facebook") public FacebookSignIn!: Button;
- @findBy("#email-signin input") private EmailSignInInput!: TextInput;
- @findBy("#email-signin button") private EmailSignInButton!: TextInput;
- @findBy(".ui.form .ui.negative.message") public ErrorBox!: WebComponent;
+ @findBy(".c-menu-item-title") public MenuTitle!: WebComponent;
+ @findBy(".welcome-message") public WelcomeMessage!: WebComponent;
+ @findBy("#input-title") public IdeaTitle!: TextInput;
+ @findBy("#input-description") public IdeaDescription!: TextInput;
+ @findBy(".c-button.m-positive") public SubmitIdea!: Button;
+ @findBy(".c-menu-item-signin") public UserMenu!: WebComponent;
+ @findBy(".c-menu-user-heading") public UserName!: WebComponent;
+ @findBy(".c-modal-window") public SignInModal!: WebComponent;
+ @findBy(".c-modal-window .c-button.m-google") public GoogleSignIn!: Button;
+ @findBy(".c-modal-window .c-button.m-facebook") public FacebookSignIn!: Button;
+ @findBy(".c-modal-window .c-signin-control #input-email") private EmailSignInInput!: TextInput;
+ @findBy(".c-modal-window .c-signin-control .c-button.m-positive") private EmailSignInButton!: TextInput;
@findBy(".signout") private SignOut!: Button;
- @findMultipleBy(".c-idea-list > .item") public IdeaList!: IdeaList;
- @findBy(".c-modal__window input") private CompleteEmailSignInInput!: TextInput;
- @findBy(".c-modal__window button") private CompleteEmailSignInButton!: Button;
+ @findMultipleBy(".c-idea-list > .c-list-item") public IdeaList!: IdeaList;
+ @findBy(".c-modal-window input") private CompleteEmailSignInInput!: TextInput;
+ @findBy(".c-modal-window button") private CompleteEmailSignInButton!: Button;
public loadCondition() {
return elementIsVisible(() => this.IdeaTitle);
diff --git a/tests/pages/ShowIdeaPage.ts b/tests/pages/ShowIdeaPage.ts
index 7cd635cab..61916002f 100644
--- a/tests/pages/ShowIdeaPage.ts
+++ b/tests/pages/ShowIdeaPage.ts
@@ -16,19 +16,19 @@ export class ShowIdeaPage extends Page {
super(browser);
}
- @findBy(".idea-header .header") public Title!: WebComponent;
+ @findBy(".idea-header h1") public Title!: WebComponent;
@findBy(".description") public Description!: WebComponent;
- @findBy(".c-response .ui.label") public Status!: WebComponent;
- @findBy(".c-response .content") public ResponseText!: WebComponent;
+ @findBy(".c-segment.l-response .status-label") public Status!: WebComponent;
+ @findBy(".c-segment.l-response .content") public ResponseText!: WebComponent;
@findBy(".c-support-counter button") public SupportCounter!: WebComponent;
- @findBy(".comment-input textarea") public CommentInput!: TextInput;
- @findBy(".comment-input button") public SubmitCommentButton!: Button;
- @findMultipleBy(".ui.comments > .comment") public CommentList!: CommentList;
- @findBy(".action-col button.respond") public RespondButton!: Button;
- @findBy(".c-modal__window .c-response-form") public ResponseModal!: WebComponent;
- @findBy(".c-modal__window .c-response-form select") private ResponseModalStatus!: DropDownList;
- @findBy(".c-modal__window .c-response-form textarea") private ResponseModalText!: TextInput;
- @findBy(".c-modal__window .c-modal__footer button.green") private ResponseModalSubmitButton!: Button;
+ @findBy(".c-comment-input #input-content") public CommentInput!: TextInput;
+ @findBy(".c-comment-input .c-button.m-positive") public SubmitCommentButton!: Button;
+ @findMultipleBy(".c-comment-list .c-comment") public CommentList!: CommentList;
+ @findBy(".action-col .c-button.respond") public RespondButton!: Button;
+ @findBy(".c-modal-window .c-response-form") public ResponseModal!: WebComponent;
+ @findBy(".c-modal-window .c-response-form #input-status") private ResponseModalStatus!: DropDownList;
+ @findBy(".c-modal-window .c-response-form #input-text") private ResponseModalText!: TextInput;
+ @findBy(".c-modal-window .c-modal-footer .c-button.m-positive") private ResponseModalSubmitButton!: Button;
public loadCondition() {
return elementIsVisible(() => this.Title);
diff --git a/tests/pages/SignUpPage.ts b/tests/pages/SignUpPage.ts
index 49c90d593..cc41912d7 100644
--- a/tests/pages/SignUpPage.ts
+++ b/tests/pages/SignUpPage.ts
@@ -11,15 +11,15 @@ export class SignUpPage extends Page {
}
@findBy("#p-signup") private Container!: WebComponent;
- @findBy("#p-signup .c-button.google") public GoogleSignIn!: Button;
- @findBy("#p-signup .c-button.facebook") public FacebookSignIn!: Button;
- @findBy("#p-signup .form #name") public UserName!: TextInput;
- @findBy("#p-signup .form #email") public UserEmail!: TextInput;
- @findBy("#p-signup .form #tenantName") public TenantName!: TextInput;
- @findBy("#p-signup .form #subdomain") public Subdomain!: TextInput;
- @findBy("#p-signup .c-button.green") public Confirm!: Button;
- @findBy("#p-signup .green.basic.label") private SubdomainOk!: WebComponent;
- @findBy(".c-modal__window") private ConfirmationModal!: WebComponent;
+ @findBy("#p-signup .c-button.m-google") public GoogleSignIn!: Button;
+ @findBy("#p-signup .c-button.m-facebook") public FacebookSignIn!: Button;
+ @findBy("#p-signup #input-name") public UserName!: TextInput;
+ @findBy("#p-signup #input-email") public UserEmail!: TextInput;
+ @findBy("#p-signup #input-tenantName") public TenantName!: TextInput;
+ @findBy("#p-signup #input-subdomain") public Subdomain!: TextInput;
+ @findBy("#p-signup .c-button.m-positive") public Confirm!: Button;
+ @findBy("#p-signup .c-message.m-success") private SubdomainOk!: WebComponent;
+ @findBy(".c-modal-window") private ConfirmationModal!: WebComponent;
public loadCondition() {
return elementIsVisible(() => this.Container);
diff --git a/views/403.html b/views/403.html
index a0c65dd33..f652c2181 100644
--- a/views/403.html
+++ b/views/403.html
@@ -1,8 +1,7 @@
{{define "javascript"}}{{end}}
{{define "content"}}
-<div class="ui middle aligned center aligned grid failure-page">
- <div class="column">
+ <div class="container failure-page">
<img src="{{.__logo}}"/>
<h1>NOT AUTHORIZED</h1>
<p>
@@ -13,5 +12,4 @@
<span>Take me back to <a href="{{ .baseURL }}">{{ .baseURL }}</a> home page.</span>
{{ end }}
</div>
-</div>
{{end}}
\ No newline at end of file
diff --git a/views/404.html b/views/404.html
index 3d93e3bb8..a0a1836cc 100644
--- a/views/404.html
+++ b/views/404.html
@@ -1,18 +1,16 @@
{{define "javascript"}}{{end}}
{{define "content"}}
- <div class="ui middle aligned center aligned grid failure-page">
- <div class="column">
- <img src="{{.__logo}}"/>
- <h1>PAGE NOT FOUND</h1>
- <p>
- The link you clicked may be broken or <br />
- the page may have been removed.
- </p>
+ <div class="container failure-page">
+ <img src="{{.__logo}}"/>
+ <h1>PAGE NOT FOUND</h1>
+ <p>
+ The link you clicked may be broken or <br />
+ the page may have been removed.
+ </p>
- {{ if .tenant }}
- <span>Take me back to <a href="{{ .baseURL }}">{{ .baseURL }}</a> home page.</span>
- {{ end }}
- </div>
+ {{ if .tenant }}
+ <span>Take me back to <a href="{{ .baseURL }}">{{ .baseURL }}</a> home page.</span>
+ {{ end }}
</div>
{{end}}
\ No newline at end of file
diff --git a/views/410.html b/views/410.html
index 80bb4a9ad..58cbf0028 100644
--- a/views/410.html
+++ b/views/410.html
@@ -1,15 +1,13 @@
{{define "javascript"}}{{end}}
{{define "content"}}
- <div class="ui middle aligned center aligned grid failure-page">
- <div class="column">
- <img src="{{.__logo}}"/>
- <h1>EXPIRED</h1>
- <p>The link you clicked has expired.</p>
+ <div class="container failure-page">
+ <img src="{{.__logo}}"/>
+ <h1>EXPIRED</h1>
+ <p>The link you clicked has expired.</p>
- {{ if .tenant }}
- <span>Take me back to <a href="{{ .baseURL }}">{{ .baseURL }}</a> home page.</span>
- {{ end }}
- </div>
+ {{ if .tenant }}
+ <span>Take me back to <a href="{{ .baseURL }}">{{ .baseURL }}</a> home page.</span>
+ {{ end }}
</div>
{{end}}
\ No newline at end of file
diff --git a/views/500.html b/views/500.html
index f078e6eb0..aba479695 100644
--- a/views/500.html
+++ b/views/500.html
@@ -1,15 +1,13 @@
{{define "javascript"}}{{end}}
{{define "content"}}
- <div class="ui middle aligned center aligned grid failure-page">
- <div class="column">
- <img src="{{.__logo}}"/>
- <h1>Shoot! Well, this is unexpected…</h1>
- <p>An error has occurred and we're working to fix the problem! </br> We’ll be up and running shortly.</p>
+ <div class="container failure-page">
+ <img src="{{.__logo}}"/>
+ <h1>Shoot! Well, this is unexpected…</h1>
+ <p>An error has occurred and we're working to fix the problem! </br> We’ll be up and running shortly.</p>
- {{ if .tenant }}
- <span>Take me back to <a href="{{ .baseURL }}">{{ .baseURL }}</a> home page.</span>
- {{ end }}
- </div>
+ {{ if .tenant }}
+ <span>Take me back to <a href="{{ .baseURL }}">{{ .baseURL }}</a> home page.</span>
+ {{ end }}
</div>
{{end}}
\ No newline at end of file
diff --git a/views/base.html b/views/base.html
index 533902fe6..65cbf2069 100644
--- a/views/base.html
+++ b/views/base.html
@@ -12,11 +12,14 @@
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ .currentURL }}" />
<meta property="og:image" content="{{ .__logo }}">
+ {{ if .tenant }}
+ <link rel="stylesheet" href="/custom/{{ .tenant.CustomCSS | md5 }}.css" />
+ {{ end }}
</head>
<body>
- <noscript class="ui container">
- <div class="ui yellow segment">
- <h2 class="ui header">Please enable JavaScript</h2>
+ <noscript class="container">
+ <div class="c-segment">
+ <h2>Please enable JavaScript</h2>
<p>This website relies on JavaScript-based technologies and services.</p>
<p>Please enable JavaScript and then reload the page.</p>
</div>
diff --git a/views/not-invited.html b/views/not-invited.html
index 355af237f..46d7af729 100644
--- a/views/not-invited.html
+++ b/views/not-invited.html
@@ -5,17 +5,15 @@ Not Invited &middot; Fider
{{define "javascript"}}{{end}}
{{define "content"}}
-<div class="ui middle aligned center aligned grid failure-page">
- <div class="column">
- <img src="{{.__logo}}"/>
- <h1>NOT INVITED</h1>
- <p>
- We couldn't find your account for your email address.
- </p>
+<div class="container failure-page">
+ <img src="{{.__logo}}"/>
+ <h1>NOT INVITED</h1>
+ <p>
+ We couldn't find your account for your email address.
+ </p>
- {{ if .tenant }}
- <span>Take me back to <a href="{{ .baseURL }}/signin">{{ .baseURL }}/signin</a>.</span>
- {{ end }}
- </div>
+ {{ if .tenant }}
+ <span>Take me back to <a href="{{ .baseURL }}/signin">{{ .baseURL }}/signin</a>.</span>
+ {{ end }}
</div>
{{end}}
\ No newline at end of file