Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

bugfix: fix for layout issue and textcolor (#250)

Guilherme Oenning698c6b124448
diff --git a/public/assets/styles/main.scss b/public/assets/styles/main.scss
index dbde8e045..a523e8089 100644
--- a/public/assets/styles/main.scss
+++ b/public/assets/styles/main.scss
@@ -6,6 +6,12 @@
text-align: center;
}
+.page::after {
+ content: "";
+ clear: both;
+ display: table;
+}
+
noscript {
margin-top: 20px;
}
@@ -53,6 +59,19 @@ body {
color: #999;
}
+.subtitle {
+ display: block;
+ &.active {
+ cursor: pointer;
+ &:hover {
+ color: $main-color;
+ }
+ i {
+ float: right;
+ }
+ }
+}
+
code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
diff --git a/public/components/ShowTag.tsx b/public/components/ShowTag.tsx
index 6173aba76..a1de9e78b 100644
--- a/public/components/ShowTag.tsx
+++ b/public/components/ShowTag.tsx
@@ -8,9 +8,9 @@ interface TagProps {
}
const getRGB = (color: string) => {
- const r = color.substring(1, 3);
- const g = color.substring(3, 5);
- const b = color.substring(5, 7);
+ const r = color.substring(0, 2);
+ const g = color.substring(2, 4);
+ const b = color.substring(4, 6);
return {
R: parseInt(r, 16),
@@ -20,11 +20,9 @@ const getRGB = (color: string) => {
};
const idealTextColor = (color: string) => {
- const nThreshold = 105;
const components = getRGB(color);
const bgDelta = (components.R * 0.299) + (components.G * 0.587) + (components.B * 0.114);
-
- return (bgDelta > 186) ? '#000000' : '#ffffff';
+ return (bgDelta > 140) ? '#333' : '#fff';
};
export const ShowTag = (props: TagProps) => {
diff --git a/public/pages/site/ShowIdeaPage/ShowIdeaPage.scss b/public/pages/site/ShowIdeaPage/ShowIdeaPage.scss
index dd662637c..15b14d9c8 100644
--- a/public/pages/site/ShowIdeaPage/ShowIdeaPage.scss
+++ b/public/pages/site/ShowIdeaPage/ShowIdeaPage.scss
@@ -12,28 +12,30 @@
}
}
+ @media only screen and (min-width: 768px) {
+ .header-col,
+ .comments-col {
+ float: left;
+ width: calc(100% - 230px);
+ }
+ .action-col {
+ float: right;
+ }
+ }
+
+ .header-col {
+ margin-bottom: 5px;
+ }
+
.action-col {
@media only screen and (min-width: 768px) {
- height: 0;
+ width: 200px;
}
.ui.list {
margin: 0.5em 0em;
}
- .subtitle {
- display: block;
- &.active {
- cursor: pointer;
- &:hover {
- color: $main-color;
- }
- i {
- float: right;
- }
- }
- }
}
-
.tag-list {
.tag-icon {
width: 10px;
diff --git a/public/pages/site/ShowIdeaPage/ShowIdeaPage.tsx b/public/pages/site/ShowIdeaPage/ShowIdeaPage.tsx
index da9b2845b..e47fbcf69 100644
--- a/public/pages/site/ShowIdeaPage/ShowIdeaPage.tsx
+++ b/public/pages/site/ShowIdeaPage/ShowIdeaPage.tsx
@@ -56,91 +56,89 @@ export class ShowIdeaPage extends React.Component<ShowIdeaPageProps, ShowIdeaPag
public render() {
return (
<div className="page ui container">
- <div className="ui stackable vertically padded grid container">
- <div className="thirteen wide column">
- <div className="ui items unstackable">
- <div className="item">
- <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} />
- ]
- : <h1 className="ui header">{this.props.idea.title}</h1>
- }
-
- <span className="info">
- Shared <Moment date={this.props.idea.createdOn} /> by <Gravatar user={this.props.idea.user} /> <UserName user={this.props.idea.user} />
- </span>
- </div>
+ <div className="header-col">
+ <div className="ui items unstackable">
+ <div className="item">
+ <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} />
+ ]
+ : <h1 className="ui header">{this.props.idea.title}</h1>
+ }
+
+ <span className="info">
+ Shared <Moment date={this.props.idea.createdOn} /> by <Gravatar user={this.props.idea.user} /> <UserName user={this.props.idea.user} />
+ </span>
</div>
</div>
+ </div>
- <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>
+ <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>
- : this.props.idea.description
- ? <MultiLineText className="description" text={this.props.idea.description} style="simple" />
- : <p className="description">This idea doesn't have a description.</p>
- }
+ </div>
+ : this.props.idea.description
+ ? <MultiLineText className="description" text={this.props.idea.description} style="simple" />
+ : <p className="description">This idea doesn't have a description.</p>
+ }
- <ShowIdeaResponse status={this.props.idea.status} response={this.props.idea.response} />
+ <ShowIdeaResponse status={this.props.idea.status} response={this.props.idea.response} />
- </div>
- <div className="three wide column action-col">
- {
- this.props.user && this.props.user.isCollaborator && [
- <span key={0} className="subtitle">Actions</span>,
- this.state.editMode
- ?
- <div key={1} className="ui list">
- <div className="item">
- <Button className="positive icon fluid text-left" onClick={async () => this.saveChanges()}>
- <i className="save icon" /> Save
- </Button>
- </div>
- <div className="item">
- <Button className="icon fluid text-left" onClick={async () => this.setState({ error: undefined, editMode: false })}>
- <i className="cancel icon" /> Cancel
+ </div>
+
+ <div className="action-col">
+ {
+ this.props.user && this.props.user.isCollaborator && [
+ <span key={0} className="subtitle">Actions</span>,
+ this.state.editMode
+ ?
+ <div key={1} className="ui list">
+ <div className="item">
+ <Button className="positive icon fluid text-left" onClick={async () => this.saveChanges()}>
+ <i className="save icon" /> Save
+ </Button>
+ </div>
+ <div className="item">
+ <Button className="icon fluid text-left" onClick={async () => this.setState({ error: undefined, editMode: false })}>
+ <i className="cancel icon" /> Cancel
+ </Button>
+ </div>
+ </div>
+ :
+ <div key={1} className="ui list">
+ <div className="item">
+ <Button className="icon fluid text-left" onClick={async () => this.setState({ editMode: true })}>
+ <i className="edit icon" /> Edit
</Button>
- </div>
</div>
- :
- <div key={1} className="ui list">
- <div className="item">
- <Button className="icon fluid text-left" onClick={async () => this.setState({ editMode: true })}>
- <i className="edit icon" /> Edit
- </Button>
- </div>
- <div className="item">
- <ResponseForm idea={this.props.idea} />
- </div>
+ <div className="item">
+ <ResponseForm idea={this.props.idea} />
</div>
- ]
- }
-
- <TagsPanel user={this.props.user} idea={this.props.idea} tags={this.props.tags} />
- </div>
- <div className="thirteen wide column">
- <div className="ui comments">
- <span className="subtitle">Discussion</span>
- <CommentList comments={this.props.comments} />
- <CommentInput user={this.props.user} idea={this.props.idea} />
- </div>
- </div>
+ </div>
+ ]
+ }
+ <TagsPanel user={this.props.user} idea={this.props.idea} tags={this.props.tags} />
</div>
+ <div className="comments-col">
+ <div className="ui comments">
+ <span className="subtitle">Discussion</span>
+ <CommentList comments={this.props.comments} />
+ <CommentInput user={this.props.user} idea={this.props.idea} />
+ </div>
+ </div>
</div>
);
}