Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

Some UI/UX refactoring and enhancements (#69)

Guilherme Oenning5f56e85d63b4
diff --git a/app/models/feedback.go b/app/models/feedback.go
index be5ab5c67..67e80111c 100644
--- a/app/models/feedback.go
+++ b/app/models/feedback.go
@@ -12,6 +12,7 @@ type Idea struct {
CreatedOn time.Time `json:"createdOn"`
User *User `json:"user"`
TotalSupporters int `json:"totalSupporters"`
+ TotalComments int `json:"totalComments"`
Status int `json:"status"`
Response *IdeaResponse `json:"response"`
}
diff --git a/app/storage/postgres/idea.go b/app/storage/postgres/idea.go
index b5704743d..f106627aa 100644
--- a/app/storage/postgres/idea.go
+++ b/app/storage/postgres/idea.go
@@ -20,6 +20,7 @@ type dbIdea struct {
CreatedOn time.Time `db:"created_on"`
User *dbUser `db:"user"`
TotalSupporters int `db:"supporters"`
+ TotalComments int `db:"comments"`
Status int `db:"status"`
Response sql.NullString `db:"response"`
RespondedOn dbx.NullTime `db:"response_date"`
@@ -35,6 +36,7 @@ func (i *dbIdea) toModel() *models.Idea {
Description: i.Description,
CreatedOn: i.CreatedOn,
TotalSupporters: i.TotalSupporters,
+ TotalComments: i.TotalComments,
Status: i.Status,
User: i.User.toModel(),
}
@@ -86,7 +88,8 @@ var (
i.slug,
i.description,
i.created_on,
- i.supporters,
+ i.supporters,
+ (SELECT COUNT(*) FROM comments c WHERE c.idea_id = i.id) as comments,
i.status,
u.id AS user_id,
u.name AS user_name,
diff --git a/public/components/CommentInput.tsx b/public/components/CommentInput.tsx
index da8983f11..4c8db000e 100644
--- a/public/components/CommentInput.tsx
+++ b/public/components/CommentInput.tsx
@@ -48,24 +48,25 @@ export class CommentInput extends React.Component<CommentInputProps, CommentInpu
public render() {
const user = this.session.getCurrentUser();
- const addComment = user ? <form className="ui reply form">
- <DisplayError error={this.state.error} />
- <div className="field">
- <textarea onKeyUp={(e) => { this.setState({ content: e.currentTarget.value }); }}
- placeholder="Leave your comment here..."></textarea>
- </div>
- <Button classes="blue" onClick={ () => this.submit() }>
- <i className="icon edit"></i> Add Comment
- </Button>
- </form> :
- <div className="ui message">
- <div className="header">
- Please log in before leaving a comment.
- </div>
- <p>This only takes a second and you'll be good to go!</p>
- <SocialSignInList orientation="horizontal" size="small" />
- </div>;
+ const button = user
+ ? <Button className="primary" onClick={ () => this.submit() }>
+ Add Comment
+ </Button>
+ : <div className="ui message">
+ <div className="header">
+ Hey! We need to know who you are
+ </div>
+ <p>This only takes a second and you'll be good to go!</p>
+ <SocialSignInList orientation="horizontal" size="small" />
+ </div>;
- return addComment;
+ return <form className="ui reply form">
+ <DisplayError error={this.state.error} />
+ <div className="field">
+ <textarea onKeyUp={(e) => { this.setState({ content: e.currentTarget.value }); }}
+ placeholder="Leave your comment here..."></textarea>
+ </div>
+ { (this.state.content || user) && button }
+ </form>;
}
}
diff --git a/public/components/ResponseForm.tsx b/public/components/ResponseForm.tsx
index ae4df1500..3b07782cb 100644
--- a/public/components/ResponseForm.tsx
+++ b/public/components/ResponseForm.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import { User, Comment, Idea } from '@fider/models';
-import { DisplayError } from '@fider/components/common';
+import { Button, DisplayError } from '@fider/components/common';
import { inject, injectables } from '@fider/di';
import { Session, IdeaService, Failure } from '@fider/services';
@@ -55,10 +55,7 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
}
public render() {
- const button = <div className="ui blue labeled submit icon button false"
- onClick={() => this.activate()}>
- <i className="icon announcement"></i>Respond
- </div>;
+ const button = <Button className="primary" onClick={async () => this.activate()}>Respond</Button>;
const form = <form className="ui reply form">
<DisplayError error={this.state.error} />
@@ -81,14 +78,12 @@ export class ResponseForm extends React.Component<ResponseFormProps, ResponseFor
placeholder="What's going on with this idea? Let your users know what are your plans...">
</textarea>
</div>
- <div className="ui blue labeled submit icon button false"
- onClick={() => this.submit()}>
- <i className="icon checkmark box"></i>Submit
- </div>
- <div className="ui submit button false"
- onClick={() => this.deactivate()}>
+ <Button className="primary" onClick={() => this.submit()}>
+ Submit
+ </Button>
+ <Button className="basic" onClick={async () => this.deactivate()}>
Cancel
- </div>
+ </Button>
</form>;
return this.state.active ? form : button;
diff --git a/public/components/SupportCounter.tsx b/public/components/SupportCounter.tsx
index 0936bdba8..76f6ac29a 100644
--- a/public/components/SupportCounter.tsx
+++ b/public/components/SupportCounter.tsx
@@ -98,7 +98,7 @@ export class SupportCounter extends React.Component<SupportCounterProps, Support
</div>
</div>
<div ref={(e) => { this.list = e!; } } className="ui popup transition hidden">
- <p className="header">Please log in to support this idea</p>
+ <p className="header">Hey! We need to know who you are</p>
<SocialSignInList orientation="horizontal" size="small" />
</div>
</div>;
diff --git a/public/components/common/Button.tsx b/public/components/common/Button.tsx
index 3d329071a..9bd154755 100644
--- a/public/components/common/Button.tsx
+++ b/public/components/common/Button.tsx
@@ -1,8 +1,9 @@
import * as React from 'react';
interface ButtonProps {
- classes?: string;
+ className?: string;
href?: string;
+ size?: 'tiny' | 'large';
onClick?: () => Promise<any>;
}
@@ -11,6 +12,9 @@ interface ButtonState {
}
export class Button extends React.Component<ButtonProps, ButtonState> {
+ public static defaultProps: Partial<ButtonProps> = {
+ size: 'tiny'
+ };
public constructor(props: ButtonProps) {
super(props);
@@ -28,7 +32,7 @@ export class Button extends React.Component<ButtonProps, ButtonState> {
}
public render() {
- const cssClasses = `ui button ${this.props.classes || ''} ${this.state.clicked ? 'loading disabled' : ''}`;
+ const cssClasses = `ui ${this.props.size} button ${this.props.className || ''} ${this.state.clicked ? 'loading disabled' : ''}`;
if (this.props.href) {
return <a href={this.props.href} className={cssClasses} onClick={() => this.click()}>
{ this.props.children }
diff --git a/public/components/common/DisplayError.tsx b/public/components/common/DisplayError.tsx
index d901cfa61..d05d4b6ac 100644
--- a/public/components/common/DisplayError.tsx
+++ b/public/components/common/DisplayError.tsx
@@ -6,7 +6,7 @@ export const DisplayError = (props: {error?: Failure}) => {
return <div></div>;
}
- return <div className="ui negative message">
+ return <div className="ui small negative message">
<p>{ props.error.message }</p>
</div>;
};
diff --git a/public/components/common/Header.tsx b/public/components/common/Header.tsx
index 6e2700884..f55cd525c 100644
--- a/public/components/common/Header.tsx
+++ b/public/components/common/Header.tsx
@@ -51,7 +51,7 @@ export class Header extends React.Component<{}, {}> {
return <div>
<EnvironmentInfo />
- <div id="menu" className="ui menu no-border">
+ <div id="menu" className="ui mini menu no-border">
<div className="ui container">
<a href="/" className="header item">
{ this.tenant.name }
diff --git a/public/components/common/SocialSignInButton.tsx b/public/components/common/SocialSignInButton.tsx
index 58dcc272d..28895baf6 100644
--- a/public/components/common/SocialSignInButton.tsx
+++ b/public/components/common/SocialSignInButton.tsx
@@ -21,7 +21,7 @@ export class SocialSignInButton extends React.Component<SocialSignInButtonProps,
const href = `${auth.endpoint}/oauth/${this.props.provider}?redirect=${location.href}`;
const classes = `${providerClassName} ${this.props.size === 'small' ? 'circular icon' : 'fluid'}`;
- return <Button href={href} classes={classes}>
+ return <Button href={href} className={classes}>
<i className={providerClassName + ' icon'}></i>
{ this.props.size === 'normal' && `Sign in with ${providerDisplayName}` }
</Button>;
diff --git a/public/index.tsx b/public/index.tsx
index c08affb8c..aa290f63c 100644
--- a/public/index.tsx
+++ b/public/index.tsx
@@ -2,9 +2,9 @@ import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { AdminHomePage } from '@fider/pages/AdminHomePage';
-import { SiteHomePage } from '@fider/pages/SiteHomePage';
+import { SiteHomePage } from '@fider/pages/home/SiteHomePage';
import { ShowIdeaPage } from '@fider/pages/ShowIdeaPage';
-import { SignUpPage } from '@fider/pages/SignUpPage';
+import { SignUpPage } from '@fider/pages/signup/SignUpPage';
import { container, injectables } from '@fider/di';
import {
Session,
diff --git a/public/main.scss b/public/main.scss
index 4c4d4c19f..3845a7d97 100644
--- a/public/main.scss
+++ b/public/main.scss
@@ -1,11 +1,15 @@
-#new-idea-input {
- margin-bottom: 20px;
+[contenteditable]:focus {
+ outline: 0px solid transparent;
}
.idea-header {
margin-left: 20px;
}
+.center {
+ text-align: center;
+}
+
code {
padding: 2px 4px;
font-size: 90%;
@@ -53,18 +57,6 @@ code {
padding: 10px 5px !important;
}
-.fdr-idea-list {
- margin-top: 40px;
-
- .ui.items > .item > .content {
- margin-left: 20px;
-
- .description {
- min-height: 10px;
- }
- }
-}
-
.fdr-response {
.content {
margin-top: 10px;
diff --git a/public/models/idea.ts b/public/models/idea.ts
index 782ea3b72..362b2763d 100644
--- a/public/models/idea.ts
+++ b/public/models/idea.ts
@@ -11,6 +11,7 @@ export interface Idea {
user: User;
response: IdeaResponse;
totalSupporters: number;
+ totalComments: number;
}
export class IdeaStatus {
diff --git a/public/pages/ShowIdeaPage.tsx b/public/pages/ShowIdeaPage.tsx
index 45e9371e2..755c19166 100644
--- a/public/pages/ShowIdeaPage.tsx
+++ b/public/pages/ShowIdeaPage.tsx
@@ -3,12 +3,11 @@ import * as React from 'react';
import { User, Comment, Idea } from '@fider/models';
import { setTitle } from '@fider/utils/page';
-import { IdeaInput } from '@fider/components/IdeaInput';
import { CommentInput } from '@fider/components/CommentInput';
import { ResponseForm } from '@fider/components/ResponseForm';
import { SupportCounter } from '@fider/components/SupportCounter';
import { ShowIdeaResponse } from '@fider/components/ShowIdeaResponse';
-import { Gravatar, Moment, MultiLineText, Footer, Header, SocialSignInButton } from '@fider/components/common';
+import { Button, Gravatar, Moment, MultiLineText, Footer, Header, SocialSignInButton } from '@fider/components/common';
import { inject, injectables } from '@fider/di';
import { Session } from '@fider/services';
@@ -47,11 +46,7 @@ export class ShowIdeaPage extends React.Component<{}, {}> {
</div>
</div>
</div>
- ) : <p>No comments yet.</p>;
-
- const respond = <div className="ui blue labeled submit icon button false">
- <i className="icon announcement"></i>Respond
- </div>;
+ ) : <p>There are no comments yet.</p>;
return <div>
<Header />
diff --git a/public/pages/SiteHomePage.tsx b/public/pages/SiteHomePage.tsx
deleted file mode 100644
index 641ed31fa..000000000
--- a/public/pages/SiteHomePage.tsx
+++ /dev/null
@@ -1,119 +0,0 @@
-import * as React from 'react';
-import { Idea, IdeaStatus, User } from '@fider/models';
-import { Gravatar, MultiLineText, Moment, Header, Footer } from '@fider/components/common';
-import { ShowIdeaResponse } from '@fider/components/ShowIdeaResponse';
-import { SupportCounter } from '@fider/components/SupportCounter';
-import { IdeaInput } from '@fider/components/IdeaInput';
-
-import { inject, injectables } from '@fider/di';
-import { Session } from '@fider/services';
-
-interface SiteHomePageState {
- ideas: Idea[];
-}
-
-export class SiteHomePage extends React.Component<{}, SiteHomePageState> {
- private user: User;
- private allIdeas: Idea[];
- private filter: HTMLDivElement;
-
- @inject(injectables.Session)
- public session: Session;
-
- constructor(props: {}) {
- super(props);
- this.user = this.session.getCurrentUser();
- this.allIdeas = this.session.get<Idea[]>('ideas') || [];
-
- this.state = {
- ideas: this.allIdeas.filter(this.filterers.recent).sort(this.sorterers.recent)
- };
- }
-
- private filterers: {[key: string]: (idea: Idea) => boolean} = {
- 'recent': (idea: Idea) => idea.status !== IdeaStatus.Completed.value && idea.status !== IdeaStatus.Declined.value,
- 'most-wanted': (idea: Idea) => idea.status !== IdeaStatus.Completed.value && idea.status !== IdeaStatus.Declined.value,
- 'completed': (idea: Idea) => idea.status === IdeaStatus.Completed.value,
- 'declined': (idea: Idea) => idea.status === IdeaStatus.Declined.value
- };
-
- private sorterers: {[key: string]: (left: Idea, right: Idea) => number} = {
- 'recent': (left: Idea, right: Idea) => new Date(right.createdOn).getTime() - new Date(left.createdOn).getTime(),
- 'most-wanted': (left: Idea, right: Idea) => right.totalSupporters - left.totalSupporters,
- 'completed': (left: Idea, right: Idea) => new Date(left.response.respondedOn).getTime() - new Date(left.response.respondedOn).getTime(),
- 'declined': (left: Idea, right: Idea) => new Date(left.response.respondedOn).getTime() - new Date(left.response.respondedOn).getTime()
- };
-
- private applyFilter(value: string) {
- this.setState({
- ideas: this.allIdeas.filter(this.filterers[value]).sort(this.sorterers[value])
- });
- }
-
- public componentDidMount() {
- $(this.filter).dropdown({
- onChange: (value: string) => {
- this.applyFilter(value);
- }
- });
- }
-
- public render() {
- const ideasList = this.state.ideas.map((x) =>
- <div className="item" key={x.id}>
- <SupportCounter user={this.user} idea={x} />
- <div className="content">
- <a href={`/ideas/${x.number}/${x.slug}`} className="header">
- { x.title }
- </a>
- <div className="description">
- <MultiLineText text={ x.description } markdown={true} />
- </div>
- <div className="extra">
- #{ x.number } shared by <Gravatar hash={x.user.gravatar}/> <u>{x.user.name}</u>
- <Moment date={x.createdOn} />
- </div>
- <ShowIdeaResponse status={ x.status } response={ x.response } />
- </div>
- </div>);
-
- const displayIdeas = (this.state.ideas.length > 0) ?
- <div className="ui divided unstackable items">
- { ideasList }
- </div>
- : <p>No ideas found for given filter.</p>;
-
- return <div>
- <Header />
- <div className="ui container">
- <h1 className="ui header">Welcome to our feedback forum!</h1>
-
- <h3>I want ...</h3>
-
- <IdeaInput />
-
- <div className="ui container fdr-idea-list">
- <h4 className="ui header">
- <i className="filter icon"></i>
- <div className="content">
- Showing {' '}
- <div className="ui inline dropdown" ref={(e) => this.filter = e!}>
- <div className="text">recent ideas</div>
- <i className="dropdown icon"></i>
- <div className="menu">
- <div className="header">What do you want to see?</div>
- <div className="item" data-value="recent" data-text="recent ideas">Recent</div>
- <div className="item" data-value="most-wanted" data-text="most wanted ideas">Most Wanted</div>
- <div className="item" data-value="completed" data-text="completed ideas">Completed</div>
- <div className="item" data-value="declined" data-text="declined ideas">Declined</div>
- </div>
- </div>
- </div>
- </h4>
- { displayIdeas }
- </div>
- </div>
- <Footer />
- </div>;
- }
-}
diff --git a/public/pages/home/IdeaFilter.tsx b/public/pages/home/IdeaFilter.tsx
new file mode 100644
index 000000000..71ca56447
--- /dev/null
+++ b/public/pages/home/IdeaFilter.tsx
@@ -0,0 +1,67 @@
+import * as React from 'react';
+import { Idea, IdeaStatus } from '@fider/models';
+
+type IdeaFilterFunction = (ideas: Idea[]) => Idea[];
+
+interface IdeaFilterProps {
+ filterChanged: (filter: IdeaFilterFunction) => void;
+}
+
+const filterers: {[key: string]: (idea: Idea) => boolean} = {
+ 'recent': (idea: Idea) => idea.status !== IdeaStatus.Completed.value && idea.status !== IdeaStatus.Declined.value,
+ 'most-wanted': (idea: Idea) => idea.status !== IdeaStatus.Completed.value && idea.status !== IdeaStatus.Declined.value,
+ 'most-discussed': (idea: Idea) => idea.status !== IdeaStatus.Completed.value && idea.status !== IdeaStatus.Declined.value,
+ 'completed': (idea: Idea) => idea.status === IdeaStatus.Completed.value,
+ 'declined': (idea: Idea) => idea.status === IdeaStatus.Declined.value
+};
+
+const sorterers: {[key: string]: (left: Idea, right: Idea) => number} = {
+ 'recent': (left: Idea, right: Idea) => new Date(right.createdOn).getTime() - new Date(left.createdOn).getTime(),
+ 'most-wanted': (left: Idea, right: Idea) => right.totalSupporters - left.totalSupporters,
+ 'most-discussed': (left: Idea, right: Idea) => right.totalComments - left.totalComments,
+ 'completed': (left: Idea, right: Idea) => new Date(left.response.respondedOn).getTime() - new Date(left.response.respondedOn).getTime(),
+ 'declined': (left: Idea, right: Idea) => new Date(left.response.respondedOn).getTime() - new Date(left.response.respondedOn).getTime()
+};
+
+const getFilter = (value: string): IdeaFilterFunction => {
+ return (ideas: Idea[]) => ideas.filter(filterers[value]).sort(sorterers[value]);
+};
+
+export class IdeaFilter extends React.Component<IdeaFilterProps, {}> {
+ private element: HTMLDivElement;
+
+ constructor(props: IdeaFilterProps) {
+ super(props);
+ }
+
+ public static defaultFilter = getFilter('recent');
+
+ public componentDidMount() {
+ $(this.element).dropdown({
+ onChange: (value: string) => {
+ this.props.filterChanged(getFilter(value));
+ }
+ });
+ }
+
+ public render() {
+ return <h4 className="ui header">
+ <i className="filter icon"></i>
+ <div className="content">
+ Showing {' '}
+ <div className="ui inline dropdown" ref={(e) => this.element = e!}>
+ <div className="text">recent ideas</div>
+ <i className="dropdown icon"></i>
+ <div className="menu">
+ <div className="header">What do you want to see?</div>
+ <div className="item" data-value="recent" data-text="recent ideas">Recent</div>
+ <div className="item" data-value="most-wanted" data-text="most wanted ideas">Most Wanted</div>
+ <div className="item" data-value="most-discussed" data-text="most discussed ideas">Most Discussed</div>
+ <div className="item" data-value="completed" data-text="completed ideas">Completed</div>
+ <div className="item" data-value="declined" data-text="declined ideas">Declined</div>
+ </div>
+ </div>
+ </div>
+ </h4>;
+ }
+}
diff --git a/public/components/IdeaInput.tsx b/public/pages/home/IdeaInput.tsx
similarity index 55%
rename from public/components/IdeaInput.tsx
rename to public/pages/home/IdeaInput.tsx
index d98a5ae1b..46795a844 100644
--- a/public/components/IdeaInput.tsx
+++ b/public/pages/home/IdeaInput.tsx
@@ -6,9 +6,11 @@ import { Session, IdeaService, Failure } from '@fider/services';
interface IdeaInputState {
title: string;
+ focused: boolean;
}
export class IdeaInput extends React.Component<{}, IdeaInputState> {
+ private title: HTMLInputElement;
private description: HTMLTextAreaElement;
private form: Form;
@@ -22,19 +24,38 @@ export class IdeaInput extends React.Component<{}, IdeaInputState> {
super();
this.state = {
title: '',
+ focused: false
};
}
+ public componentDidMount() {
+ this.title.focus();
+ }
+
public async submit() {
- this.form.clearFailure();
- const result = await this.service.addIdea(this.state.title, this.description.value);
- if (result.ok) {
- location.href = `/ideas/${result.data.number}/${result.data.slug}`;
- } else if (result.error) {
- this.form.setFailure(result.error);
+ if (this.state.title) {
+ this.form.clearFailure();
+ const result = await this.service.addIdea(this.state.title, this.description.value);
+ if (result.ok) {
+ location.href = `/ideas/${result.data.number}/${result.data.slug}`;
+ } else if (result.error) {
+ this.form.setFailure(result.error);
+ }
}
}
+ public titleChanged(title: string) {
+ this.setState({ title });
+ }
+
+ public titleFocused() {
+ this.setState({ focused: true });
+ }
+
+ public titleUnfocused() {
+ this.setState({ focused: false });
+ }
+
public render() {
const user = this.session.getCurrentUser();
const details = user ?
@@ -44,30 +65,28 @@ export class IdeaInput extends React.Component<{}, IdeaInputState> {
rows={6}
placeholder="Describe your idea (optional)"></textarea>
</div>
- <Button classes="primary" onClick={() => this.form.submit() }>
+ <Button className="primary" onClick={() => this.form.submit() }>
Submit Idea
</Button>
</div> :
<div>
<div className="ui message">
<div className="header">
- Please log in before posting an idea
+ Hey! We need to know who you are
</div>
<p>This only takes a second and you'll be good to go!</p>
- <SocialSignInList orientation="horizontal" size="small" />
+ <SocialSignInList orientation="horizontal" size="small" />
</div>
</div>;
return <Form ref={(f) => { this.form = f!; } } onSubmit={() => this.submit()}>
- <div className="ui fluid input">
- <input id="new-idea-input"
- type="text"
- maxLength={100}
- onKeyUp={(e) => { this.setState({ title: e.currentTarget.value }); }}
- placeholder="Enter your idea, new feature or suggestion here ..." />
- </div>
-
- { this.state.title && details }
+ <input id="new-idea-input"
+ type="text"
+ ref={(e) => this.title = e! }
+ maxLength={100}
+ onKeyUp={(e) => { this.setState({ title: e.currentTarget.value }); }}
+ placeholder="Tell us your ideas" />
+ { (this.session.getCurrentUser() || this.state.title) && details }
</Form>;
}
}
diff --git a/public/pages/home/SiteHomePage.scss b/public/pages/home/SiteHomePage.scss
new file mode 100644
index 000000000..421c35127
--- /dev/null
+++ b/public/pages/home/SiteHomePage.scss
@@ -0,0 +1,61 @@
+.SiteHomePage {
+ h1.ui.header:first-child {
+ margin: 30px 0px;
+ }
+
+ .fdr-idea-list {
+ > .item {
+ min-height: 105px;
+ }
+
+ > .item > .content {
+ margin-left: 20px;
+
+ .description {
+ min-height: 10px;
+ }
+ }
+ }
+
+ #new-idea-input {
+ margin-bottom: 20px;
+ border: none;
+ border-bottom: 1.5px dashed #a291fb;
+ color: #a291fb;
+ font-size: 20px;
+ }
+
+ #new-idea-input::-webkit-input-placeholder { /* WebKit, Blink, Edge */
+ color: #a291fb;
+ }
+ #new-idea-input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
+ color: #a291fb;
+ opacity: 1;
+ }
+ #new-idea-input::-moz-placeholder { /* Mozilla Firefox 19+ */
+ color: #a291fb;
+ opacity: 1;
+ }
+ #new-idea-input:-ms-input-placeholder { /* Internet Explorer 10-11 */
+ color: #a291fb;
+ }
+ #new-idea-input::-ms-input-placeholder { /* Microsoft Edge */
+ color: #a291fb;
+ }
+
+ .idea-title {
+ color: rgb(162, 145, 251);
+ cursor: pointer;
+ max-width: 80%;
+ border-bottom: 2px dotted rgb(162, 145, 251);
+ display: inline-block;
+ padding-right: 9px;
+ padding-left: 10px;
+ text-align: left;
+ font-size: 20px;
+ text-decoration: none;
+ line-height: 30px;
+ list-style: none;
+ margin-bottom: 20px;
+ }
+}
\ No newline at end of file
diff --git a/public/pages/home/SiteHomePage.tsx b/public/pages/home/SiteHomePage.tsx
new file mode 100644
index 000000000..d2d4fb7c3
--- /dev/null
+++ b/public/pages/home/SiteHomePage.tsx
@@ -0,0 +1,88 @@
+import * as React from 'react';
+import { Idea, IdeaStatus, User } from '@fider/models';
+import { Gravatar, MultiLineText, Moment, Header, Footer } from '@fider/components/common';
+import { ShowIdeaResponse } from '@fider/components/ShowIdeaResponse';
+import { SupportCounter } from '@fider/components/SupportCounter';
+import { IdeaInput } from './IdeaInput';
+import { IdeaFilter } from './IdeaFilter';
+
+import { inject, injectables } from '@fider/di';
+import { Session } from '@fider/services';
+
+import './SiteHomePage.scss';
+
+interface SiteHomePageState {
+ ideas: Idea[];
+}
+
+export class SiteHomePage extends React.Component<{}, SiteHomePageState> {
+ private user: User;
+ private allIdeas: Idea[];
+ private filter: HTMLDivElement;
+
+ @inject(injectables.Session)
+ public session: Session;
+
+ constructor(props: {}) {
+ super(props);
+ this.user = this.session.getCurrentUser();
+ this.allIdeas = this.session.get<Idea[]>('ideas') || [];
+
+ this.state = {
+ ideas: IdeaFilter.defaultFilter(this.allIdeas)
+ };
+ }
+
+ public render() {
+ const ideasList = this.state.ideas.map((x) =>
+ <div className="item" key={x.id}>
+ <SupportCounter user={this.user} idea={x} />
+ <div className="content">
+ <a href={`/ideas/${x.number}/${x.slug}`} className="header">
+ { x.title }
+ </a>
+ <MultiLineText className="description" text={ x.description } markdown={true} />
+ <ShowIdeaResponse status={ x.status } response={ x.response } />
+ <div className="extra">
+ Shared <Moment date={x.createdOn} />
+ <div style={{float: 'right'}}>{ x.totalComments } <i className="comments icon"/></div>
+ </div>
+ </div>
+ </div>);
+
+ const displayIdeas = (this.state.ideas.length > 0) ?
+ <div className="ui divided unstackable items fdr-idea-list">
+ { ideasList }
+ </div>
+ : <p>No ideas found for given filter.</p>;
+
+ return <div className="SiteHomePage">
+ <Header />
+ <div className="ui container">
+ <h1 className="ui header">Welcome to our feedback forum!</h1>
+
+ <div className="ui grid stackable">
+ <div className="six wide column">
+ <p>We'd love to hear what you're thinking about. This is the place for you to submit your feedback.</p>
+ <IdeaInput />
+ </div>
+ <div className="ten wide column">
+ {
+ this.allIdeas.length === 0
+ ? <div className="center">
+ <p><i className="icon lightbulb" aria-hidden="true"></i></p>
+ <p>It's lonely out here. Start by sharing an idea!</p>
+ </div>
+ : <div>
+ <IdeaFilter filterChanged={(filter) => this.setState({ ideas: filter(this.allIdeas) }) } />
+ { displayIdeas }
+ </div>
+ }
+ </div>
+ </div>
+
+ </div>
+ <Footer />
+ </div>;
+ }
+}
diff --git a/public/pages/signup.scss b/public/pages/signup/SignUpPage.scss
similarity index 100%
rename from public/pages/signup.scss
rename to public/pages/signup/SignUpPage.scss
diff --git a/public/pages/SignUpPage.tsx b/public/pages/signup/SignUpPage.tsx
similarity index 97%
rename from public/pages/SignUpPage.tsx
rename to public/pages/signup/SignUpPage.tsx
index 644813000..ac22ef570 100644
--- a/public/pages/SignUpPage.tsx
+++ b/public/pages/signup/SignUpPage.tsx
@@ -10,7 +10,7 @@ const logo = require('@fider/images/logo-small.png');
import { inject, injectables } from '@fider/di';
import { Session, TenantService, Failure } from '@fider/services';
-import './signup.scss';
+import './SignUpPage.scss';
interface OAuthUser {
token: string;
@@ -152,7 +152,7 @@ export class SignUpPage extends React.Component<{}, SignUpPageState> {
<p>Make sure information provided above is correct before proceeding.</p>
- <Button classes="positive" onClick={() => this.form.submit()}>Confirm</Button>
+ <Button className="positive" size="large" onClick={() => this.form.submit()}>Confirm</Button>
</div>
<Footer />
</div>;