Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

refactor: better CSS naming and convetions (#383)

Guilherme Oenning04c368cabad4
diff --git a/app/cmd/routes.go b/app/cmd/routes.go
index d54d0dd13..c9545f7ee 100644
--- a/app/cmd/routes.go
+++ b/app/cmd/routes.go
@@ -47,7 +47,7 @@ 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/:id", handlers.Logo())
+ avatar.Get("/logo/:size/:id", handlers.Logo())
}
open := r.Group()
diff --git a/app/handlers/images.go b/app/handlers/images.go
index dc2dce3d4..40f43e39f 100644
--- a/app/handlers/images.go
+++ b/app/handlers/images.go
@@ -9,6 +9,8 @@ import (
"net/http"
"strings"
+ "github.com/getfider/fider/app/pkg/img"
+
"github.com/getfider/fider/app/pkg/web"
"github.com/goenning/letteravatar"
)
@@ -57,7 +59,7 @@ func Avatar() web.HandlerFunc {
}
}
-//Logo returns current tenant logo
+//Logo returns tenant logo by its ID on a given size
func Logo() web.HandlerFunc {
return func(c web.Context) error {
id, err := c.ParamAsInt("id")
@@ -65,11 +67,21 @@ func Logo() web.HandlerFunc {
return c.Failure(err)
}
+ size, err := c.ParamAsInt("size")
+ if err != nil {
+ return c.Failure(err)
+ }
+
logo, err := c.Services().Tenants.GetLogo(id)
if err != nil {
return c.Failure(err)
}
- return c.Blob(http.StatusOK, logo.ContentType, logo.Content)
+ bytes, err := img.Resize(logo.Content, size)
+ if err != nil {
+ return c.Failure(err)
+ }
+
+ return c.Blob(http.StatusOK, logo.ContentType, bytes)
}
}
diff --git a/app/pkg/img/img.go b/app/pkg/img/img.go
index f94c880b6..3e792186a 100644
--- a/app/pkg/img/img.go
+++ b/app/pkg/img/img.go
@@ -4,12 +4,14 @@ import (
"bytes"
"image"
- // These are the supported image formats
- _ "image/gif"
- _ "image/jpeg"
- _ "image/png"
+ "image/gif"
+ "image/jpeg"
+ "image/png"
stdError "errors"
+
+ "github.com/getfider/fider/app/pkg/errors"
+ "golang.org/x/image/draw"
)
//ErrNotSupported returned by Parse when given file is not in a supported format
@@ -37,3 +39,35 @@ func Parse(file []byte) (*File, error) {
Height: image.Height,
}, nil
}
+
+//Resize image based on given size
+func Resize(file []byte, size int) ([]byte, error) {
+ src, format, err := image.Decode(bytes.NewReader(file))
+ if err != nil {
+ return nil, errors.Wrap(err, "failed to decode image")
+ }
+
+ srcBounds := src.Bounds()
+ srcW, srcH := srcBounds.Dx(), srcBounds.Dy()
+ if (srcW <= size && srcH <= size) || srcW != srcH {
+ return file, nil
+ }
+
+ dst := image.NewRGBA(image.Rect(0, 0, size, size))
+ draw.BiLinear.Scale(dst, dst.Bounds(), src, srcBounds, draw.Src, nil)
+
+ writer := new(bytes.Buffer)
+ if format == "png" {
+ err = png.Encode(writer, dst)
+ } else if format == "jpeg" {
+ err = jpeg.Encode(writer, dst, nil)
+ } else if format == "gif" {
+ err = gif.Encode(writer, dst, nil)
+ }
+
+ if err != nil {
+ return nil, errors.Wrap(err, "failed to encode image to '%s'", format)
+ }
+
+ return writer.Bytes(), nil
+}
diff --git a/app/pkg/img/img_test.go b/app/pkg/img/img_test.go
index 19ac37ccc..ff038566a 100644
--- a/app/pkg/img/img_test.go
+++ b/app/pkg/img/img_test.go
@@ -9,7 +9,7 @@ import (
"github.com/getfider/fider/app/pkg/img"
)
-var testCases = []struct {
+var parseTestCases = []struct {
fileName string
width int
height int
@@ -20,13 +20,15 @@ var testCases = []struct {
{"/app/pkg/img/testdata/logo3.gif", 1165, 822, true},
{"/app/pkg/img/testdata/logo4.png", 150, 150, true},
{"/app/pkg/img/testdata/logo5.png", 200, 200, true},
+ {"/app/pkg/img/testdata/logo6.jpg", 400, 400, true},
+ {"/app/pkg/img/testdata/logo7.gif", 400, 400, true},
{"/favicon.ico", 0, 0, false},
}
func TestImageParse(t *testing.T) {
RegisterT(t)
- for _, testCase := range testCases {
+ for _, testCase := range parseTestCases {
bytes, err := ioutil.ReadFile(env.Path(testCase.fileName))
Expect(err).IsNil()
@@ -42,3 +44,35 @@ func TestImageParse(t *testing.T) {
}
}
}
+
+var resizeTestCases = []struct {
+ fileName string
+ resizedFileName string
+ size int
+}{
+ {"/app/pkg/img/testdata/logo1.png", "/app/pkg/img/testdata/logo1-200x200.png", 200},
+ {"/app/pkg/img/testdata/logo2.jpg", "/app/pkg/img/testdata/logo2.jpg", 200},
+ {"/app/pkg/img/testdata/logo3.gif", "/app/pkg/img/testdata/logo3.gif", 200},
+ {"/app/pkg/img/testdata/logo4.png", "/app/pkg/img/testdata/logo4-100x100.png", 100},
+ {"/app/pkg/img/testdata/logo5.png", "/app/pkg/img/testdata/logo5.png", 200},
+ {"/app/pkg/img/testdata/logo6.jpg", "/app/pkg/img/testdata/logo6-200x200.jpg", 200},
+ {"/app/pkg/img/testdata/logo7.gif", "/app/pkg/img/testdata/logo7-200x200.gif", 200},
+ {"/app/pkg/img/testdata/logo7.gif", "/app/pkg/img/testdata/logo7.gif", 1000},
+}
+
+func TestImageResize(t *testing.T) {
+ RegisterT(t)
+
+ for _, testCase := range resizeTestCases {
+ bytes, err := ioutil.ReadFile(env.Path(testCase.fileName))
+ Expect(err).IsNil()
+
+ resized, err := img.Resize(bytes, testCase.size)
+ Expect(err).IsNil()
+
+ expected, err := ioutil.ReadFile(env.Path(testCase.resizedFileName))
+ Expect(err).IsNil()
+
+ Expect(resized).Equals(expected)
+ }
+}
diff --git a/app/pkg/img/testdata/logo1-200x200.png b/app/pkg/img/testdata/logo1-200x200.png
new file mode 100755
index 000000000..3953c6403
Binary files /dev/null and b/app/pkg/img/testdata/logo1-200x200.png differ
diff --git a/app/pkg/img/testdata/logo4-100x100.png b/app/pkg/img/testdata/logo4-100x100.png
new file mode 100755
index 000000000..60dda66e8
Binary files /dev/null and b/app/pkg/img/testdata/logo4-100x100.png differ
diff --git a/app/pkg/img/testdata/logo6-200x200.jpg b/app/pkg/img/testdata/logo6-200x200.jpg
new file mode 100755
index 000000000..913e91551
Binary files /dev/null and b/app/pkg/img/testdata/logo6-200x200.jpg differ
diff --git a/app/pkg/img/testdata/logo6.jpg b/app/pkg/img/testdata/logo6.jpg
new file mode 100644
index 000000000..293035ea4
Binary files /dev/null and b/app/pkg/img/testdata/logo6.jpg differ
diff --git a/app/pkg/img/testdata/logo7-200x200.gif b/app/pkg/img/testdata/logo7-200x200.gif
new file mode 100755
index 000000000..bdcf76bda
Binary files /dev/null and b/app/pkg/img/testdata/logo7-200x200.gif differ
diff --git a/app/pkg/img/testdata/logo7.gif b/app/pkg/img/testdata/logo7.gif
new file mode 100644
index 000000000..3cd870fb3
Binary files /dev/null and b/app/pkg/img/testdata/logo7.gif differ
diff --git a/app/pkg/web/renderer.go b/app/pkg/web/renderer.go
index 87d94f30c..6e6736fae 100644
--- a/app/pkg/web/renderer.go
+++ b/app/pkg/web/renderer.go
@@ -111,8 +111,8 @@ func (r *Renderer) Render(w io.Writer, name string, props Props, ctx *Context) e
m["__StyleBundle"] = r.cssBundle
m["__ContextID"] = ctx.ContextID()
if ctx.Tenant() != nil && ctx.Tenant().LogoID > 0 {
- m["__logo"] = fmt.Sprintf("%s/logo/%d", ctx.BaseURL(), ctx.Tenant().LogoID)
- m["__favicon"] = m["__logo"]
+ m["__logo"] = fmt.Sprintf("%s/logo/200/%d", ctx.BaseURL(), ctx.Tenant().LogoID)
+ m["__favicon"] = fmt.Sprintf("%s/logo/50/%d", ctx.BaseURL(), ctx.Tenant().LogoID)
} else {
m["__logo"] = "https://getfider.com/images/logo-100x100.png"
m["__favicon"] = "/favicon.ico"
diff --git a/public/assets/styles/form.scss b/public/assets/styles/form.scss
index 61818140a..033942604 100644
--- a/public/assets/styles/form.scss
+++ b/public/assets/styles/form.scss
@@ -4,7 +4,6 @@
}
.info.clickable {
color: $link-color;
- cursor: pointer;
}
}
diff --git a/public/assets/styles/global.scss b/public/assets/styles/global.scss
new file mode 100644
index 000000000..028806cf8
--- /dev/null
+++ b/public/assets/styles/global.scss
@@ -0,0 +1,57 @@
+@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/main.scss b/public/assets/styles/main.scss
index c71639309..734bd40ec 100644
--- a/public/assets/styles/main.scss
+++ b/public/assets/styles/main.scss
@@ -1,4 +1,5 @@
@import 'variables.scss';
+@import 'global.scss';
@import 'form.scss';
@import 'semantic.scss';
@@ -27,6 +28,11 @@ noscript {
body {
background-color: $bg-color;
+ color: $text-color;
+}
+
+code {
+ font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
body, h1, h2, h3, h4, h5, .ui, input {
@@ -35,68 +41,24 @@ body, h1, h2, h3, h4, h5, .ui, input {
-webkit-font-smoothing: antialiased;
}
-#environment-info {
- padding: 2px;
- border-radius: 0px;
-}
-
-#menu {
- margin-top: 0px;
- background-color: $menu-color;
- margin-bottom: 30px;
- height: 50px;
- border-radius: 0px;
- border: none;
-
- .unread-dot {
- width: 10px;
- height: 10px;
- border-radius: 5px;
- margin-left: -10px;
- margin-top: -25px;
- background-color: #db2828;
- border: 1px solid #fff !important;
- }
-
- .name.header {
- min-width: 150px;
- }
-
- .title {
- img {
- margin-right: 10px;
- width: auto;
- height: auto;
- max-height: 36px;
- }
- span {
- font-size: 18px;
- margin: 0 0 0 0;
- }
- }
-
- div, a {
- color: textColorFor($menu-color);
- &:hover {
- background: $menu-color;
- }
- }
-}
-
.info {
font-size: 80%;
- color: rgba(0,0,0,.6);
+ color: rgba($text-color, .7);
+}
+
+.info.right {
+ float: right;
}
.center {
text-align: center;
}
-.info.right {
- float: right;
+.clickable {
+ cursor: pointer;
}
-#menu div.subtitle,
+.ui.menu .subtitle,
.subtitle {
font-size: 11px;
font-weight: 600;
@@ -109,19 +71,12 @@ body, h1, h2, h3, h4, h5, .ui, input {
display: block;
&.active {
cursor: pointer;
- &:hover {
- color: $main-color;
- }
i {
float: right;
}
}
}
-code {
- font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
-}
-
.markdown-body {
overflow-wrap: break-word;
word-break: break-word;
@@ -166,46 +121,14 @@ code {
}
}
-.fdr-avatar {
- border-radius: 50%;
- width: 30px;
- height: 30px;
- vertical-align: middle;
- padding: 1px;
- &.staff {
- border: 1px solid $admin-color;
- }
-}
-
-.no-margin {
- margin: 0px !important;
-}
-
-.name {
- color: #4f5e6b;
- font-weight: 500;
- &.staff {
- font-weight: 700;
- color: $admin-color;
- }
-}
-
-.fdr-profile-popup div.item {
- padding: 5px 0px !important;
-}
-
-.ui.segment.fdr-response {
+.ui.segment.c-response {
padding: 0.5em;
.content {
margin-top: 10px;
}
- .label {
- text-transform: uppercase;
- }
-
- .fdr-avatar {
+ .c-avatar {
margin-left: 3px;
}
@@ -214,30 +137,6 @@ code {
}
}
-#footer {
- #powered-by {
- text-align: center;
- font-size: 11px;
- a {
- display: block;
- span {
- display: block;
- }
-
- img {
- width: 15px;
- filter: grayscale(100%);
- }
-
- &:hover {
- img {
- filter: grayscale(0%);
- }
- }
- }
- }
-}
-
.ui[class*="top pointing"].label:before,
.ui[class*="pointing above"].label:before ,
.ui[class*="bottom pointing"].label:before,
@@ -283,30 +182,6 @@ code {
}
}
-
-.ui.main-color {
- background-color: $main-color;
- color: #fff;
-
- &.not-animated:hover {
- background-color: $main-color;
- color: #fff;
- }
-
- &.inverted, &.not-animated.inverted:hover {
- box-shadow: 0 0 0 2px lighten( $main-color, 10% ) inset !important;
- background-color: #fff;
- color: lighten( $main-color, 10% );
- }
-
-
- &.animated:hover, &.animated.inverted:hover {
- box-shadow: 0 0 0 2px darken( $main-color, 10% ) inset !important;
- background-color: darken( $main-color, 10% );
- color: #fff;
- }
-}
-
.failure-page {
height: 60%;
p {
@@ -316,6 +191,10 @@ code {
font-size: 200%;
color: #3b4450;
}
+ img {
+ max-height: 100px;
+ max-width: 100px;
+ }
}
.c-toast {
diff --git a/public/assets/styles/variables.scss b/public/assets/styles/variables.scss
index 84ac48693..5abba5e79 100644
--- a/public/assets/styles/variables.scss
+++ b/public/assets/styles/variables.scss
@@ -1,16 +1,17 @@
+$font-size-micro: 9px;
$font-size-mini: 10px;
$font-size-tiny: 11px;
$font-size-small: 12px;
$font-size: 14px;
$font-size-large: 16px;
$font-size-big: 18px;
+$font-size-xlarge: 22px;
$main-color: #0069ff;
$admin-color: #365899;
$bg-color: #fdfdfd;
$menu-color: #fff;
$text-color: #333;
-
$link-color: #07C;
// Buttons
diff --git a/public/components/ShowIdeaResponse.tsx b/public/components/ShowIdeaResponse.tsx
index 01b5049c6..e510c8ae9 100644
--- a/public/components/ShowIdeaResponse.tsx
+++ b/public/components/ShowIdeaResponse.tsx
@@ -17,7 +17,7 @@ const DuplicateDetails = (props: IdeaResponseProps): JSX.Element | null => {
return (
<div className="content">
<span>&#8618;</span>
- <span title={status.title} className={`ui mini empty circular ${status.color} label`} />
+ <span title={status.title} className={`status-${status.slug}`} />
<a href={`/ideas/${original.number}/${original.slug}`}>{original.title}</a>
</div>
);
@@ -36,8 +36,8 @@ export const ShowIdeaResponse = (props: IdeaResponseProps): JSX.Element => {
if (props.response && status.show) {
return (
- <div className="fdr-response item ui segment">
- <span className={`ui mini label ${status.color}`}>{status.title}</span>
+ <div className="c-response item ui segment">
+ <span className={`gm-status-label gm-status-${status.slug}`}>{status.title}</span>
<Gravatar user={props.response.user} /> <UserName user={props.response.user} />
<span className="info">
<Moment date={props.response.respondedOn} />
diff --git a/public/components/SupportCounter.scss b/public/components/SupportCounter.scss
index 1c465495f..91b793fb0 100644
--- a/public/components/SupportCounter.scss
+++ b/public/components/SupportCounter.scss
@@ -11,13 +11,15 @@
width: 45px;
font-weight: 700;
cursor: pointer;
- background-color: $bg-color;
+ background-color: transparent;
text-align: center;
margin: 0 auto;
padding: 0 0;
- i.icon {
- color: #C4C9CD;
+ &:hover {
+ .icon {
+ color: inherit;
+ }
}
}
@@ -25,15 +27,6 @@
@include disabled();
}
- button.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 cd9cf6ef7..014d016f9 100644
--- a/public/components/SupportCounter.tsx
+++ b/public/components/SupportCounter.tsx
@@ -49,12 +49,21 @@ export class SupportCounter extends React.Component<SupportCounterProps, Support
const className = classSet({
supported: !status.closed && this.state.supported,
disabled: status.closed,
- "no-touch": !device.isTouch()
+ "no-touch": !device.isTouch(),
+ "gm-text": !this.state.supported,
+ "gm-primary": this.state.supported,
+ "gm-primary-hover": true
});
const vote = (
<button className={className} onClick={async () => await this.supportOrUndo()}>
- <i className="medium caret up icon" />
+ <i
+ className={classSet({
+ "medium caret up icon": true,
+ "gm-text-lighter": !this.state.supported,
+ "gm-primary": this.state.supported
+ })}
+ />
{this.state.total}
</button>
);
diff --git a/public/components/common/Button.scss b/public/components/common/Button.scss
index 0849744f4..eb75c4b47 100644
--- a/public/components/common/Button.scss
+++ b/public/components/common/Button.scss
@@ -3,16 +3,23 @@
.c-button {
cursor: pointer;
font-size: $font-size;
- color: $text-color;
border-radius: 3px;
- background-color: $gray-lighter;
border: none;
margin: 0 4px 0 0;
padding: 10px;
text-align: left;
font-weight: 700;
- &.green {
+ &.default {
+ color: $text-color;
+ background-color: $gray-lighter;
+
+ &:hover {
+ background-color: $gray-darker;
+ }
+ }
+
+ &.positive {
color: $white;
background-color: $green;
@@ -21,7 +28,7 @@
}
}
- &.red {
+ &.danger {
color: $red;
border: 1px solid $red;
background-color: transparent;
@@ -32,10 +39,6 @@
}
}
- &:hover {
- background-color: $gray-darker;
- }
-
&.mini {
padding: 7px;
font-size: $font-size-mini;
@@ -76,8 +79,8 @@
&.loading {
position: relative;
cursor: default;
- text-shadow: none!important;
- color: transparent!important;
+ text-shadow: none !important;
+ color: transparent !important;
opacity: 1;
pointer-events: auto;
-webkit-transition: all 0s linear,opacity .1s ease;
diff --git a/public/components/common/Button.tsx b/public/components/common/Button.tsx
index 2570d4637..f6cb613df 100644
--- a/public/components/common/Button.tsx
+++ b/public/components/common/Button.tsx
@@ -6,7 +6,7 @@ interface ButtonProps {
simple?: boolean;
disabled?: boolean;
href?: string;
- color?: "green" | "red";
+ color?: "positive" | "danger" | "default";
fluid?: boolean;
size?: "mini" | "tiny" | "small" | "normal" | "large";
onClick?: (event: ButtonClickEvent) => Promise<any>;
@@ -33,7 +33,8 @@ export class Button extends React.Component<ButtonProps, ButtonState> {
public static defaultProps: Partial<ButtonProps> = {
size: "small",
- fluid: false
+ fluid: false,
+ color: "default"
};
public constructor(props: ButtonProps) {
diff --git a/public/components/common/EnvironmentInfo.tsx b/public/components/common/EnvironmentInfo.tsx
index b947b809c..f685b2441 100644
--- a/public/components/common/EnvironmentInfo.tsx
+++ b/public/components/common/EnvironmentInfo.tsx
@@ -12,7 +12,7 @@ export class EnvironmentInfo extends React.Component<EnvironmentInfoProps, {}> {
}
return (
- <div id="environment-info" className=" ui mini negative message no-border no-margin">
+ <div className="c-env-info">
Env: {this.props.system.environment} | Compiler: {this.props.system.compiler} | Version:{" "}
{this.props.system.version} | BuildTime: {this.props.system.buildTime}
</div>
diff --git a/public/components/common/Footer.scss b/public/components/common/Footer.scss
new file mode 100644
index 000000000..953491ebe
--- /dev/null
+++ b/public/components/common/Footer.scss
@@ -0,0 +1,37 @@
+@import '~@fider/assets/styles/variables.scss';
+
+#c-footer {
+ div {
+ text-align: center;
+ font-size: 11px;
+ border-top: 1px solid $gray-lighter;
+ padding: 20px;
+ margin: 20px;
+
+ a {
+ color: rgba($text-color, 0.5);
+ display: inline-block;
+ span {
+ display: none;
+ }
+
+ &:hover {
+ span {
+ display: block;
+ }
+ }
+
+ img {
+ width: 20px;
+ margin-top: 10px;
+ filter: grayscale(100%);
+ }
+
+ &:hover {
+ img {
+ filter: grayscale(0%);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/public/components/common/Footer.tsx b/public/components/common/Footer.tsx
index 2dc826b95..bcd0c5133 100644
--- a/public/components/common/Footer.tsx
+++ b/public/components/common/Footer.tsx
@@ -1,19 +1,16 @@
+import "./Footer.scss";
+
import * as React from "react";
const logo = require("@fider/assets/images/logo-small.png");
export const Footer = () => {
return (
- <div id="footer" className="ui vertical footer segment">
- <div className="ui center aligned container">
- <div className="ui inverted section divider" />
- <div className="ui horizontal small divided link list">
- <div id="powered-by">
- <a className="item" target="_blank" href="https://getfider.com/">
- <span>Powered by Fider</span>
- <img src={logo} />
- </a>
- </div>
- </div>
+ <div id="c-footer">
+ <div className="ui container">
+ <a target="_blank" href="https://getfider.com/">
+ <img src={logo} alt="Fider" />
+ <span>Powered by Fider</span>
+ </a>
</div>
</div>
);
diff --git a/public/components/common/Gravatar.scss b/public/components/common/Gravatar.scss
new file mode 100644
index 000000000..cf9e9ec56
--- /dev/null
+++ b/public/components/common/Gravatar.scss
@@ -0,0 +1,13 @@
+@import '~@fider/assets/styles/variables.scss';
+
+.c-avatar {
+ border-radius: 50%;
+ width: 30px;
+ height: 30px;
+ vertical-align: middle;
+ padding: 1px;
+ &.gm-staff {
+ border-width: 1px;
+ border-style: solid;
+ }
+}
\ No newline at end of file
diff --git a/public/components/common/Gravatar.tsx b/public/components/common/Gravatar.tsx
index 340403fb8..5ec2ddd60 100644
--- a/public/components/common/Gravatar.tsx
+++ b/public/components/common/Gravatar.tsx
@@ -1,5 +1,7 @@
+import "./Gravatar.scss";
+
import * as React from "react";
-import { page } from "@fider/services";
+import { page, classSet } from "@fider/services";
import { User, UserRole } from "@fider/models";
interface GravatarProps {
@@ -13,13 +15,10 @@ export const Gravatar = (props: GravatarProps) => {
const url = `${page.getBaseUrl()}/avatars/50/${id}/${encodeURIComponent(name)}`;
const isCollaborator = props.user ? props.user.role >= UserRole.Collaborator : false;
- let element: any;
- return (
- <img
- ref={e => (element = e)}
- className={`ui fdr-avatar image ${isCollaborator && "staff"}`}
- title={name}
- src={url}
- />
- );
+ const className = classSet({
+ "c-avatar": true,
+ "gm-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 19f2eaa89..bf2ef2fa0 100644
--- a/public/components/common/Header.scss
+++ b/public/components/common/Header.scss
@@ -1,7 +1,76 @@
-.c-header {
+@import '~@fider/assets/styles/variables.scss';
+
+#c-header {
.ui.vertical.menu .item > .label {
float: none;
position: absolute;
right: 5px;
}
-}
\ No newline at end of file
+
+ .c-env-info {
+ padding: 2px;
+ border-radius: 0px;
+ font-size: 10px;
+ color: $red;
+ border-bottom: 1px solid $red;
+ background-color: rgba($red, 0.05);
+ }
+
+ .ui.borderless.menu {
+ margin-top: 0px;
+ height: 50px;
+ border-radius: 0px;
+ border: none;
+ @include media("phone") {
+ height: 30px;
+ }
+
+ &:last-child {
+ margin-bottom: 30px;
+ }
+
+ .unread-dot {
+ width: 10px;
+ height: 10px;
+ border-radius: 5px;
+ margin-left: -10px;
+ margin-top: -25px;
+ background-color: #db2828;
+ border: 1px solid #fff !important;
+ }
+
+ .title {
+ img {
+ margin-right: 10px;
+ width: auto;
+ height: auto;
+ max-height: 36px;
+ @include media("phone") {
+ max-height: 26px;
+ margin-right: 5px;
+ }
+ }
+ span {
+ font-size: $font-size-big;
+ margin: 0 0 0 0;
+ color: #484848;
+ font-weight: 700;
+ @include media("phone") {
+ font-size: $font-size;
+ max-width: 240px;
+ }
+ }
+ }
+
+ .signin {
+ font-size: 90%;
+ i.dropdown {
+ margin: 0 0 0 0.5em;
+ }
+ }
+
+ .item:hover {
+ background: transparent;
+ }
+ }
+}
diff --git a/public/components/common/Header.tsx b/public/components/common/Header.tsx
index 5ed4d2171..fb00bf386 100644
--- a/public/components/common/Header.tsx
+++ b/public/components/common/Header.tsx
@@ -3,7 +3,7 @@ import "./Header.scss";
import * as React from "react";
import { SystemSettings, CurrentUser, Tenant } from "@fider/models";
import { SignInModal, SignInControl, EnvironmentInfo, Gravatar, Logo } from "@fider/components";
-import { page, actions } from "@fider/services";
+import { page, actions, classSet } from "@fider/services";
interface HeaderProps {
user?: CurrentUser;
@@ -35,11 +35,11 @@ export class Header extends React.Component<HeaderProps, HeaderState> {
}
}
- private showModal() {
+ private showModal = () => {
if (!this.props.user) {
this.setState({ showSignIn: true });
}
- }
+ };
public render() {
const items = this.props.user && (
@@ -75,22 +75,23 @@ 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,
+ subtitle: !this.props.user
+ });
return (
- <div className="c-header">
+ <div id="c-header">
<EnvironmentInfo system={this.props.system} />
<SignInModal isOpen={this.state.showSignIn} />
- <div id="menu" className="ui small borderless menu">
+ <div className="ui borderless menu">
<div className="ui container">
- <a href="/" className="header item title">
+ <a href="/" className="item title">
<Logo tenant={this.props.tenant} />
<span>{this.props.tenant.name}</span>
</a>
{showRightMenu && (
- <div
- onClick={() => this.showModal()}
- className={`ui right simple dropdown item signin ${!this.props.user && "subtitle"}`}
- >
+ <div onClick={this.showModal} className={profileMenuClassName}>
{this.props.user && <Gravatar user={this.props.user} />}
{this.state.unreadNotifications > 0 && <div className="unread-dot" />}
{!this.props.user && "Sign in"} {this.props.user && <i className="dropdown icon" />}
diff --git a/public/components/common/Logo.tsx b/public/components/common/Logo.tsx
index 2ea6dceb9..adc7e8e7c 100644
--- a/public/components/common/Logo.tsx
+++ b/public/components/common/Logo.tsx
@@ -11,7 +11,7 @@ export const Logo = (props: LogoProps) => {
return <img src={props.url} />;
}
if (props.tenant && props.tenant.logoId > 0) {
- return <img src={`/logo/${props.tenant.logoId}`} alt={props.tenant.name} />;
+ return <img src={`/logo/50/${props.tenant.logoId}`} alt={props.tenant.name} />;
}
return null;
};
diff --git a/public/components/common/SignInControl.tsx b/public/components/common/SignInControl.tsx
index 78fe78e59..53ef35ed8 100644
--- a/public/components/common/SignInControl.tsx
+++ b/public/components/common/SignInControl.tsx
@@ -109,7 +109,7 @@ export class SignInControl extends React.Component<SignInControlProps, SignInCon
placeholder="[email protected]"
className="small"
/>
- <Button color="green" disabled={this.state.email === ""} onClick={() => this.signIn()}>
+ <Button color="positive" disabled={this.state.email === ""} onClick={() => this.signIn()}>
Sign in
</Button>
</div>
diff --git a/public/components/common/UserName.scss b/public/components/common/UserName.scss
new file mode 100644
index 000000000..f7916206c
--- /dev/null
+++ b/public/components/common/UserName.scss
@@ -0,0 +1,6 @@
+@import '~@fider/assets/styles/variables.scss';
+
+.c-username {
+ color: #4f5e6b;
+ font-weight: 500;
+}
\ No newline at end of file
diff --git a/public/components/common/UserName.tsx b/public/components/common/UserName.tsx
index c573f0c2f..4e0436e26 100644
--- a/public/components/common/UserName.tsx
+++ b/public/components/common/UserName.tsx
@@ -1,5 +1,8 @@
+import "./UserName.scss";
+
import * as React from "react";
import { User, UserRole } from "@fider/models";
+import { classSet } from "@fider/services";
interface UserNameProps {
user: User;
@@ -7,5 +10,11 @@ interface UserNameProps {
export const UserName = (props: UserNameProps) => {
const isCollaborator = props.user.role >= UserRole.Collaborator;
- return <span className={`name ${isCollaborator ? "staff" : ""}`}>{props.user.name}</span>;
+
+ const className = classSet({
+ "c-username": true,
+ "gm-staff": isCollaborator
+ });
+
+ return <span className={className}>{props.user.name}</span>;
};
diff --git a/public/models/idea.ts b/public/models/idea.ts
index 02b8cb18b..70bde4e5a 100644
--- a/public/models/idea.ts
+++ b/public/models/idea.ts
@@ -23,16 +23,15 @@ export class IdeaStatus {
public slug: string,
public show: boolean,
public closed: boolean,
- public filterable: boolean,
- public color: string
+ public filterable: boolean
) {}
- public static Open = new IdeaStatus(0, "Open", "open", false, false, false, "");
- public static Planned = new IdeaStatus(4, "Planned", "planned", true, false, true, "violet");
- public static Started = new IdeaStatus(1, "Started", "started", true, false, true, "blue");
- public static Completed = new IdeaStatus(2, "Completed", "completed", true, true, true, "green");
- public static Declined = new IdeaStatus(3, "Declined", "declined", true, true, true, "red");
- public static Duplicate = new IdeaStatus(5, "Duplicate", "duplicate", true, true, false, "yellow");
+ public static Open = new IdeaStatus(0, "Open", "open", false, false, false);
+ public static Planned = new IdeaStatus(4, "Planned", "planned", true, false, true);
+ public static Started = new IdeaStatus(1, "Started", "started", true, false, true);
+ public static Completed = new IdeaStatus(2, "Completed", "completed", true, true, true);
+ public static Declined = new IdeaStatus(3, "Declined", "declined", true, true, true);
+ public static Duplicate = new IdeaStatus(5, "Duplicate", "duplicate", true, true, false);
public static Get(value: number): IdeaStatus {
for (const status of IdeaStatus.All) {
diff --git a/public/pages/Administration/components/TagForm.tsx b/public/pages/Administration/components/TagForm.tsx
index cc7d62042..3a7a2dfc2 100644
--- a/public/pages/Administration/components/TagForm.tsx
+++ b/public/pages/Administration/components/TagForm.tsx
@@ -120,7 +120,7 @@ export class TagForm extends React.Component<TagFormProps, TagFormState> {
</div>
</div>
<Button onClick={async () => this.props.onCancel()}>Cancel</Button>
- <Button color="green" onClick={e => this.onSave(e)}>
+ <Button color="positive" onClick={e => this.onSave(e)}>
Save
</Button>
</div>
diff --git a/public/pages/Administration/pages/GeneralSettings.page.tsx b/public/pages/Administration/pages/GeneralSettings.page.tsx
index 876792143..c55c34e9c 100644
--- a/public/pages/Administration/pages/GeneralSettings.page.tsx
+++ b/public/pages/Administration/pages/GeneralSettings.page.tsx
@@ -216,7 +216,7 @@ export class GeneralSettingsPage extends AdminBasePage<GeneralSettingsPageProps,
]}
{this.props.user.isAdministrator && (
<div className="field">
- <Button color="green" onClick={async e => await this.save(e)}>
+ <Button color="positive" onClick={async e => await this.save(e)}>
Save
</Button>
</div>
diff --git a/public/pages/Administration/pages/Invitations.page.tsx b/public/pages/Administration/pages/Invitations.page.tsx
index 4d4a15865..81c977fb7 100644
--- a/public/pages/Administration/pages/Invitations.page.tsx
+++ b/public/pages/Administration/pages/Invitations.page.tsx
@@ -156,7 +156,7 @@ ${this.props.user.name} (${this.props.tenant.name})`,
<div className="field">
<p className="info">Whenever you're ready, click the following button to send out these invites.</p>
- <Button onClick={this.sendInvites} color="green" disabled={this.state.numOfRecipients === 0}>
+ <Button onClick={this.sendInvites} color="positive" disabled={this.state.numOfRecipients === 0}>
Send {this.state.numOfRecipients} {this.state.numOfRecipients === 1 ? "invite" : "invites"}
</Button>
</div>
diff --git a/public/pages/Administration/pages/ManageMembers.page.tsx b/public/pages/Administration/pages/ManageMembers.page.tsx
index cc470cdbc..e4d860340 100644
--- a/public/pages/Administration/pages/ManageMembers.page.tsx
+++ b/public/pages/Administration/pages/ManageMembers.page.tsx
@@ -71,7 +71,7 @@ export class ManageMembersPage extends AdminBasePage<ManageMembersPageProps, Man
{removable && (
<Button
size="tiny"
- color="red"
+ color="danger"
onClick={() => this.changeRole(user, UserRole.Visitor)}
className="showover"
>
@@ -79,7 +79,7 @@ export class ManageMembersPage extends AdminBasePage<ManageMembersPageProps, Man
</Button>
)}
{addable && (
- <Button size="tiny" color="green" onClick={() => this.changeRole(user, role)} className="showover">
+ <Button size="tiny" color="positive" onClick={() => this.changeRole(user, role)} className="showover">
<i className="add icon" />Add
</Button>
)}
diff --git a/public/pages/Administration/pages/ManageTags.page.tsx b/public/pages/Administration/pages/ManageTags.page.tsx
index 04cdb7672..f4dbe8233 100644
--- a/public/pages/Administration/pages/ManageTags.page.tsx
+++ b/public/pages/Administration/pages/ManageTags.page.tsx
@@ -98,7 +98,7 @@ export class ManageTagsPage extends AdminBasePage<ManageTagsPageProps, ManageTag
<Button className="right floated" onClick={async () => this.setState({ deleting: undefined })}>
Cancel
</Button>
- <Button color="red" className="right floated" onClick={() => this.deleteTag(t)}>
+ <Button color="danger" className="right floated" onClick={() => this.deleteTag(t)}>
Delete tag
</Button>
</div>
@@ -152,7 +152,7 @@ export class ManageTagsPage extends AdminBasePage<ManageTagsPageProps, ManageTag
</div>
) : (
<Button
- color="green"
+ color="positive"
onClick={async e =>
this.setState({
isAdding: true,
diff --git a/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx b/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx
index 7e5f3ba91..e58bdeb5f 100644
--- a/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx
+++ b/public/pages/CompleteSignInProfile/CompleteSignInProfile.page.tsx
@@ -49,7 +49,7 @@ export class CompleteSignInProfilePage extends React.Component<HomePageProps, Co
placeholder="Your display name"
className="small"
/>
- <Button onClick={() => this.submit()} color="green" disabled={this.state.name === ""}>
+ <Button onClick={() => this.submit()} color="positive" disabled={this.state.name === ""}>
Submit
</Button>
</div>
diff --git a/public/pages/Home/Home.page.scss b/public/pages/Home/Home.page.scss
index 70957957d..ba461fbfa 100644
--- a/public/pages/Home/Home.page.scss
+++ b/public/pages/Home/Home.page.scss
@@ -6,15 +6,16 @@
margin-bottom: 20px;
}
- .fdr-idea-list {
+ .c-idea-list {
> .item {
- a.title {
+ border-top: 0.1px solid $gray-lighter;
+ &:first-child {
+ border-top: none;
+ }
+
+ .title {
max-width: 85%;
- color: #000;
font-size: 18px;
- &:hover {
- color: $main-color;
- }
}
.content {
@@ -75,13 +76,12 @@
#new-idea-input {
margin-bottom: 20px;
border: none;
- border-bottom: 1px dashed $main-color;
+ border-bottom: 1px dashed $gray-darker;
+ background-color: transparent;
font-size: 18px;
- background-color: $bg-color;
padding: 0px 0px 10px 0px;
font-weight: 700;
margin: 0px 0px 10px 0px;
border-radius: 0;
}
-
}
\ No newline at end of file
diff --git a/public/pages/Home/components/IdeaInput.tsx b/public/pages/Home/components/IdeaInput.tsx
index 11739f7c3..3d08602cf 100644
--- a/public/pages/Home/components/IdeaInput.tsx
+++ b/public/pages/Home/components/IdeaInput.tsx
@@ -87,7 +87,7 @@ export class IdeaInput extends React.Component<IdeaInputProps, IdeaInputState> {
placeholder="Describe your idea"
/>
</div>
- <Button color="green" onClick={e => this.submit(e)}>
+ <Button color="positive" onClick={e => this.submit(e)}>
Submit
</Button>
</div>
diff --git a/public/pages/Home/components/IdeasContainer.tsx b/public/pages/Home/components/IdeasContainer.tsx
index e716659cc..0a9367523 100644
--- a/public/pages/Home/components/IdeasContainer.tsx
+++ b/public/pages/Home/components/IdeasContainer.tsx
@@ -85,7 +85,7 @@ export class IdeasContainer extends React.Component<IdeasContainerProps, IdeasCo
return (
<>
<h3 className="ui dividing header">
- <i className="lightbulb icon blue" />
+ <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>
diff --git a/public/pages/Home/components/ListIdeas.tsx b/public/pages/Home/components/ListIdeas.tsx
index f23e952b4..e1745d302 100644
--- a/public/pages/Home/components/ListIdeas.tsx
+++ b/public/pages/Home/components/ListIdeas.tsx
@@ -25,7 +25,7 @@ const ListIdeaItem = (props: { idea: Idea; user?: CurrentUser; tags: Tag[] }) =>
{props.idea.totalComments} <i className="comments outline icon" />
</div>
)}
- <a className="title" href={`/ideas/${props.idea.number}/${props.idea.slug}`}>
+ <a className="title gm-text gm-primary-hover" href={`/ideas/${props.idea.number}/${props.idea.slug}`}>
{props.idea.title}
</a>
<MultiLineText className="description" text={props.idea.description} style="simple" />
@@ -58,7 +58,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 fdr-idea-list">
+ <div className="ui divided unstackable items c-idea-list">
{ideasToList.map(idea => (
<ListIdeaItem
key={idea.id}
@@ -68,7 +68,7 @@ export class ListIdeas extends React.Component<ListIdeasProps, ListIdeasState> {
/>
))}
{this.props.ideas.length > this.state.showCount && (
- <h5 className="ui blue header show-more" onTouchEnd={e => this.showMore(e)} onClick={e => this.showMore(e)}>
+ <h5 className="gm-primary show-more" onTouchEnd={e => this.showMore(e)} onClick={e => this.showMore(e)}>
View {this.props.ideas.length - this.state.showCount} more ideas
</h5>
)}
diff --git a/public/pages/MySettings/MySettings.page.tsx b/public/pages/MySettings/MySettings.page.tsx
index 6e41482de..47ac3c43c 100644
--- a/public/pages/MySettings/MySettings.page.tsx
+++ b/public/pages/MySettings/MySettings.page.tsx
@@ -120,7 +120,7 @@ export class MySettingsPage extends React.Component<MySettingsPageProps, MySetti
value={this.state.newEmail}
onChange={e => this.setState({ newEmail: e.currentTarget.value })}
/>
- <Button color="green" size="mini" onClick={async () => await this.submitNewEmail()}>
+ <Button color="positive" size="mini" onClick={async () => await this.submitNewEmail()}>
Confirm
</Button>
<Button
@@ -169,7 +169,7 @@ export class MySettingsPage extends React.Component<MySettingsPageProps, MySetti
/>
<div className="field">
- <Button color="green" onClick={async () => await this.confirm()}>
+ <Button color="positive" onClick={async () => await this.confirm()}>
Confirm
</Button>
</div>
diff --git a/public/pages/ShowIdea/ShowIdea.page.scss b/public/pages/ShowIdea/ShowIdea.page.scss
index e6ffd5ffc..2d625bd9e 100644
--- a/public/pages/ShowIdea/ShowIdea.page.scss
+++ b/public/pages/ShowIdea/ShowIdea.page.scss
@@ -11,8 +11,12 @@
h1 {
font-weight: 400;
margin: 0px;
+ font-size: $font-size-xlarge;
+ @include media("phone") {
+ font-size: $font-size-big;
+ }
}
- .fdr-avatar {
+ .c-avatar {
width: 24px;
height: 24px;
}
@@ -66,7 +70,7 @@
}
.ui.comments {
- .fdr-avatar {
+ .c-avatar {
margin-right: 5px;
vertical-align: top;
margin-top: 2px;
@@ -97,8 +101,8 @@
}
}
-.fdr-response-form {
- .fdr-idea-search {
+.c-response-form {
+ .c-idea-search {
.support {
text-align: center;
width: 50px;
@@ -107,8 +111,9 @@
margin: 0;
}
}
- .label {
+ .gm-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 4c53df043..453a4e3c2 100644
--- a/public/pages/ShowIdea/ShowIdea.page.tsx
+++ b/public/pages/ShowIdea/ShowIdea.page.tsx
@@ -83,7 +83,7 @@ export class ShowIdeaPage extends React.Component<ShowIdeaPageProps, ShowIdeaPag
<DisplayError key={0} fields={["title"]} pointing="above" error={this.state.error} />
]
) : (
- <h1 className="ui header">{this.props.idea.title}</h1>
+ <h1>{this.props.idea.title}</h1>
)}
<span className="info">
@@ -123,7 +123,7 @@ export class ShowIdeaPage extends React.Component<ShowIdeaPageProps, ShowIdeaPag
this.state.editMode ? (
<div key={1} className="ui list">
<div className="item">
- <Button color="green" fluid={true} onClick={async () => this.saveChanges()}>
+ <Button color="positive" fluid={true} onClick={async () => this.saveChanges()}>
<i className="save icon" /> Save
</Button>
</div>
diff --git a/public/pages/ShowIdea/components/CommentInput.tsx b/public/pages/ShowIdea/components/CommentInput.tsx
index 0ad84bdac..bc2446e39 100644
--- a/public/pages/ShowIdea/components/CommentInput.tsx
+++ b/public/pages/ShowIdea/components/CommentInput.tsx
@@ -84,7 +84,7 @@ export class CommentInput extends React.Component<CommentInputProps, CommentInpu
/>
</div>
{this.state.content && (
- <Button color="green" onClick={() => this.submit()}>
+ <Button color="positive" onClick={() => this.submit()}>
Submit
</Button>
)}
diff --git a/public/pages/ShowIdea/components/CommentList.tsx b/public/pages/ShowIdea/components/CommentList.tsx
index 705191961..2780b3711 100644
--- a/public/pages/ShowIdea/components/CommentList.tsx
+++ b/public/pages/ShowIdea/components/CommentList.tsx
@@ -96,9 +96,9 @@ export class CommentList extends React.Component<CommentListProps, CommentListSt
{this.canEditComment(c) && (
<div className="metadata">
·{" "}
- <Button simple={true} onClick={() => this.startEdit(c)}>
+ <span className="clickable" onClick={() => this.startEdit(c)}>
edit
- </Button>
+ </span>
</div>
)}
<div className="text">
@@ -117,7 +117,7 @@ export class CommentList extends React.Component<CommentListProps, CommentListSt
}
/>
</div>
- <Button size="tiny" onClick={() => this.confirmEdit()} color="green">
+ <Button size="tiny" onClick={() => this.confirmEdit()} color="positive">
Save
</Button>
<Button size="tiny" onClick={() => this.cancelEdit()}>
diff --git a/public/pages/ShowIdea/components/IdeaSearch.tsx b/public/pages/ShowIdea/components/IdeaSearch.tsx
index 903278442..bbf599b39 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={`ui mini label ${status.color}`}>{status.title}</span>
+ <span className={`gm-status-label gm-status-${status.slug}`}>{status.title}</span>
{i.title}
</>
)
@@ -68,7 +68,7 @@ export class IdeaSearch extends React.Component<IdeaSearchProps, IdeaSearchState
return (
<Dropdown
- className="fdr-idea-search"
+ className="c-idea-search"
fluid={true}
selectOnBlur={false}
selection={true}
diff --git a/public/pages/ShowIdea/components/ModerationPanel.tsx b/public/pages/ShowIdea/components/ModerationPanel.tsx
index f67b07c74..70a81fb90 100644
--- a/public/pages/ShowIdea/components/ModerationPanel.tsx
+++ b/public/pages/ShowIdea/components/ModerationPanel.tsx
@@ -66,7 +66,7 @@ export class ModerationPanel extends React.Component<ModerationPanelProps, Moder
</Modal.Content>
<Modal.Footer>
- <Button color="red" onClick={async () => this.delete()}>
+ <Button color="danger" onClick={async () => this.delete()}>
Delete
</Button>
<Button onClick={async () => this.close()}>Cancel</Button>
@@ -81,7 +81,7 @@ export class ModerationPanel extends React.Component<ModerationPanelProps, Moder
<div className="ui list">
<div className="item">
<Button
- color="red"
+ color="danger"
size="tiny"
fluid={true}
onClick={async () => this.setState({ showConfirmation: true })}
diff --git a/public/pages/ShowIdea/components/ResponseForm.tsx b/public/pages/ShowIdea/components/ResponseForm.tsx
index 38a0f3be3..6de5eea0c 100644
--- a/public/pages/ShowIdea/components/ResponseForm.tsx
+++ b/public/pages/ShowIdea/components/ResponseForm.tsx
@@ -53,7 +53,7 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
const modal = (
<Modal.Window isOpen={this.state.showModal} center={false} size="large">
<Modal.Content>
- <div className="ui form fdr-response-form">
+ <div className="ui form c-response-form">
<DisplayError fields={["status"]} error={this.state.error} />
<div className="two fields">
<div className="field">
@@ -100,7 +100,7 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
</Modal.Content>
<Modal.Footer>
- <Button color="green" onClick={() => this.submit()}>
+ <Button color="positive" onClick={() => this.submit()}>
Submit
</Button>
<Button onClick={async () => this.setState({ showModal: false })}>Cancel</Button>
diff --git a/public/pages/ShowIdea/components/TagsPanel.tsx b/public/pages/ShowIdea/components/TagsPanel.tsx
index 86b589a49..7acef62c2 100644
--- a/public/pages/ShowIdea/components/TagsPanel.tsx
+++ b/public/pages/ShowIdea/components/TagsPanel.tsx
@@ -81,7 +81,7 @@ export class TagsPanel extends React.Component<TagsPanelProps, TagsPanelState> {
</div>
);
- const subtitleClasses = `subtitle ${this.state.canEdit && "active"}`;
+ const subtitleClasses = `subtitle ${this.state.canEdit && "active gm-primary-hover"}`;
const icon =
this.state.canEdit &&
(this.state.isEditing ? <i className="check circle icon" /> : <i className="setting icon" />);
diff --git a/public/pages/SignUp/SignUp.page.scss b/public/pages/SignUp/SignUp.page.scss
index 3c4a29ad3..d8c3f1178 100644
--- a/public/pages/SignUp/SignUp.page.scss
+++ b/public/pages/SignUp/SignUp.page.scss
@@ -2,10 +2,6 @@
margin-top: 50px;
max-width: 500px !important;
- .fdr-avatar {
- margin-right: 5px;
- }
-
.logo {
max-height: 100px;
margin: 0 auto;
diff --git a/public/pages/SignUp/SignUp.page.tsx b/public/pages/SignUp/SignUp.page.tsx
index 6b5c6de98..182d3362f 100644
--- a/public/pages/SignUp/SignUp.page.tsx
+++ b/public/pages/SignUp/SignUp.page.tsx
@@ -118,8 +118,7 @@ export class SignUpPage extends React.Component<SignUpPageProps, SignUpPageState
{this.user ? (
<p>
- Hello, &nbsp;
- <b>{this.user.name}</b> {this.user.email && `(${this.user.email})`}
+ Hello, <b>{this.user.name}</b> {this.user.email && `(${this.user.email})`}
</p>
) : (
<>
@@ -189,7 +188,7 @@ export class SignUpPage extends React.Component<SignUpPageProps, SignUpPageState
<p>Make sure information provided above is correct before proceeding.</p>
- <Button color="green" size="large" onClick={() => this.confirm()}>
+ <Button color="positive" size="large" onClick={() => this.confirm()}>
Confirm
</Button>
</div>
diff --git a/public/services/utils.spec.ts b/public/services/utils.spec.ts
index 0b579633b..4bcf64a39 100644
--- a/public/services/utils.spec.ts
+++ b/public/services/utils.spec.ts
@@ -7,7 +7,9 @@ import { readFileSync } from "fs";
{ input: {}, expected: "" },
{ input: { green: true }, expected: "green" },
{ input: { disabled: false, green: false }, expected: "" },
- { input: { disabled: true, green: true }, expected: "disabled green" }
+ { 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" }
].forEach(x => {
test(`classSet of ${JSON.stringify(x.input)} should be ${x.expected}`, () => {
const className = classSet(x.input);
diff --git a/tests/pages/HomePage.ts b/tests/pages/HomePage.ts
index 65b6ba572..8cada9127 100644
--- a/tests/pages/HomePage.ts
+++ b/tests/pages/HomePage.ts
@@ -39,7 +39,7 @@ export class HomePage extends Page {
@findBy("#email-signin button") private EmailSignInButton!: TextInput;
@findBy(".ui.form .ui.negative.message") public ErrorBox!: WebComponent;
@findBy(".signout") private SignOut!: Button;
- @findMultipleBy(".fdr-idea-list > .item") public IdeaList!: IdeaList;
+ @findMultipleBy(".c-idea-list > .item") public IdeaList!: IdeaList;
@findBy(".c-modal__window input") private CompleteEmailSignInInput!: TextInput;
@findBy(".c-modal__window button") private CompleteEmailSignInButton!: Button;
diff --git a/tests/pages/ShowIdeaPage.ts b/tests/pages/ShowIdeaPage.ts
index 12eea57b2..7cd635cab 100644
--- a/tests/pages/ShowIdeaPage.ts
+++ b/tests/pages/ShowIdeaPage.ts
@@ -18,16 +18,16 @@ export class ShowIdeaPage extends Page {
@findBy(".idea-header .header") public Title!: WebComponent;
@findBy(".description") public Description!: WebComponent;
- @findBy(".fdr-response .ui.label") public Status!: WebComponent;
- @findBy(".fdr-response .content") public ResponseText!: WebComponent;
+ @findBy(".c-response .ui.label") public Status!: WebComponent;
+ @findBy(".c-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 .fdr-response-form") public ResponseModal!: WebComponent;
- @findBy(".c-modal__window .fdr-response-form select") private ResponseModalStatus!: DropDownList;
- @findBy(".c-modal__window .fdr-response-form textarea") private ResponseModalText!: TextInput;
+ @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;
public loadCondition() {
diff --git a/views/base.html b/views/base.html
index 27c96b447..1153de130 100644
--- a/views/base.html
+++ b/views/base.html
@@ -12,6 +12,26 @@
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ .baseURL }}" />
<meta property="og:image" content="{{ .__logo }}">
+ <style rel="stylesheet" nonce="{{ .__ContextID }}">
+ /* .gm-primary {
+ color: red;
+ }
+
+ .gm-primary-hover:hover {
+ color: red;
+ }
+
+ .gs-planned {
+ background-color: pink;
+ }
+
+ a {
+ color: red;
+ }
+ a:hover {
+ color: red;
+ } */
+ </style>
</head>
<body>
<noscript class="ui container">