diff --git a/app/javascript/components/Board/BoardP.tsx b/app/javascript/components/Board/BoardP.tsx index 923940da..708fe837 100644 --- a/app/javascript/components/Board/BoardP.tsx +++ b/app/javascript/components/Board/BoardP.tsx @@ -74,7 +74,7 @@ class BoardP extends React.Component { const { filters } = posts; return ( -
+
{ {board.description} { isLoggedIn ? - + : Log in / Sign up diff --git a/app/javascript/components/Board/NewPostForm.tsx b/app/javascript/components/Board/NewPostForm.tsx index a39f66a6..608a64a2 100644 --- a/app/javascript/components/Board/NewPostForm.tsx +++ b/app/javascript/components/Board/NewPostForm.tsx @@ -1,5 +1,7 @@ import * as React from 'react'; +import Button from '../shared/Button'; + interface Props { title: string; description: string; @@ -41,11 +43,9 @@ const NewPostForm = ({ id="postDescription" >
- +
); diff --git a/app/javascript/components/Board/PostList.tsx b/app/javascript/components/Board/PostList.tsx index 48972c9d..794218a2 100644 --- a/app/javascript/components/Board/PostList.tsx +++ b/app/javascript/components/Board/PostList.tsx @@ -32,7 +32,7 @@ const PostList = ({ page, hasMore }: Props) => ( -
+
{ error ? {error} : null } ( -
+
{title} {description} -
+
{ postStatus ? : null }
diff --git a/app/javascript/components/Board/PostStatusListItem.tsx b/app/javascript/components/Board/PostStatusListItem.tsx index 9025643d..7f918f6b 100644 --- a/app/javascript/components/Board/PostStatusListItem.tsx +++ b/app/javascript/components/Board/PostStatusListItem.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import PostStatusLabel from '../shared/PostStatusLabel'; +import Button from '../shared/Button'; interface Props { name: string; @@ -19,17 +20,18 @@ const PostStatusListItem = ({ handleResetFilter, }: Props) => (
- -
+ +
{ isCurrentFilter ? - + : null } diff --git a/app/javascript/components/Board/index.tsx b/app/javascript/components/Board/index.tsx index 42090b49..e111c90a 100644 --- a/app/javascript/components/Board/index.tsx +++ b/app/javascript/components/Board/index.tsx @@ -4,8 +4,6 @@ import { Provider } from 'react-redux'; import Board from '../../containers/Board'; import createStoreHelper from '../../helpers/createStore'; -import '../../stylesheets/components/Board.scss'; - import IBoard from '../../interfaces/IBoard'; interface Props { diff --git a/app/javascript/components/Roadmap/PostListByPostStatus.tsx b/app/javascript/components/Roadmap/PostListByPostStatus.tsx index 00c479eb..0504b507 100644 --- a/app/javascript/components/Roadmap/PostListByPostStatus.tsx +++ b/app/javascript/components/Roadmap/PostListByPostStatus.tsx @@ -14,13 +14,13 @@ interface Props { } const PostListByPostStatus = ({ postStatus, posts, boards }: Props) => ( -
-
+
{postStatus.name}
-
+
( -
+
{title} {boardName}
diff --git a/app/javascript/components/Roadmap/index.tsx b/app/javascript/components/Roadmap/index.tsx index 8c8f263b..0cf7bd03 100644 --- a/app/javascript/components/Roadmap/index.tsx +++ b/app/javascript/components/Roadmap/index.tsx @@ -6,8 +6,6 @@ import IPostStatus from '../../interfaces/IPostStatus'; import IPostJSON from '../../interfaces/json/IPost'; import IBoard from '../../interfaces/IBoard'; -import '../../stylesheets/components/Roadmap.scss'; - interface Props { postStatuses: Array; posts: Array; @@ -19,7 +17,7 @@ class Roadmap extends React.Component { const { postStatuses, posts, boards } = this.props; return ( -
+
{postStatuses.map((postStatus, i) => ( ( + +); + +export default Button; \ No newline at end of file diff --git a/app/javascript/components/shared/CustomTexts.tsx b/app/javascript/components/shared/CustomTexts.tsx index 5d8c17af..acdad1d9 100644 --- a/app/javascript/components/shared/CustomTexts.tsx +++ b/app/javascript/components/shared/CustomTexts.tsx @@ -10,27 +10,27 @@ interface DescriptionTextProps { } export const TitleText = ({ children }: Props) => ( - {children} + {children} ); export const MutedText = ({ children }: Props) => ( - {children} + {children} ); export const UppercaseText = ({ children }: Props) => ( - {children} + {children} ); export const SuccessText = ({ children }: Props) => ( - {children} + {children} ); export const DangerText = ({ children }: Props) => ( - {children} + {children} ); export const DescriptionText = ({ children, limit = 90}: DescriptionTextProps) => ( - + { children && children.length > limit ? children.slice(0, limit-1) + '...' diff --git a/app/javascript/stylesheets/components/Board.scss b/app/javascript/stylesheets/components/Board.scss index bb1ef259..abb2c717 100644 --- a/app/javascript/stylesheets/components/Board.scss +++ b/app/javascript/stylesheets/components/Board.scss @@ -1,4 +1,20 @@ .boardContainer { + @extend + .d-flex, + .justify-content-between, + .align-items-start; + + flex-direction: row; + + .sidebar { + position: sticky; + top: 20px; + + .sidebarBox { + width: 250px; + } + } + @media (max-width: 800px) { flex-direction: column; @@ -13,26 +29,14 @@ } } - @media (min-width: 801px) { - flex-direction: row; - - .sidebar { - position: sticky; - top: 20px; - - .sidebarBox { - width: 250px; - } - } - } - .sidebarBox { - flex: 0 0 auto; - - display: flex; - flex-direction: column; - justify-content: flex-start; - align-items: center; + @extend + .d-flex, + .flex-column, + .justify-content-start, + .align-items-center, + .flex-grow-0, + .flex-shrink-0; border: thin solid black; border-radius: 4px; @@ -41,7 +45,21 @@ padding: 8px; } + .postStatusListItemContainer { + @extend + .d-flex, + .align-self-stretch; + } + + .postStatusListItemLink { + @extend + .flex-grow-1; + } + .postStatusListItem { + @extend + .p-1; + height: 40px; &:hover { @@ -53,13 +71,21 @@ } .resetFilter { - flex: 0 0 auto; + @extend + .flex-grow-0, + .flex-shrink-0, + .align-self-center, + .p-0; + width: 30px; height: 30px; + } - padding: 0; - - align-self: center; + .postList { + @extend + .d-flex, + .flex-column, + .flex-grow-1; } .postLink { @@ -67,14 +93,29 @@ border-radius: 4px; margin: 8px 0; color: black; - } - - .postLink:hover { - text-decoration: none; - background-color: #f5f5f5; + + &:hover { + text-decoration: none; + background-color: #f5f5f5; + } } .postListItem { + @extend + .d-flex, + .flex-column, + .justify-content-between, + .m-0, + .px-2, + .py-1; + height: 114px; } + + .postDetails { + @extend + .d-flex, + .justify-content-between, + .text-uppercase; + } } \ No newline at end of file diff --git a/app/javascript/stylesheets/components/Roadmap.scss b/app/javascript/stylesheets/components/Roadmap.scss index 667e8fde..fc14fbc0 100644 --- a/app/javascript/stylesheets/components/Roadmap.scss +++ b/app/javascript/stylesheets/components/Roadmap.scss @@ -1,17 +1,33 @@ .roadmapColumns { - @media (max-width: 800px) { - .roadmapColumn { + @extend + .d-flex, + .justify-content-between, + .flex-wrap; + + .roadmapColumn { + @extend + .card, + .my-2, + .px-2; + + width: 32%; + + @media (max-width: 800px) { width: 100%; } } - - @media (min-width: 801px) { - .roadmapColumn { - width: 32%; - } + + .columnHeader { + @extend + .card-header, + .d-flex, + .bg-transparent; } .scrollContainer { + @extend + .card-body; + overflow-y: auto; max-height: 350px; } @@ -19,4 +35,12 @@ .postLink:hover { text-decoration: none; } + + .postListItem { + @extend + .d-flex, + .flex-column, + .my-1, + .py-2; + } } \ No newline at end of file diff --git a/app/javascript/stylesheets/general/_custom_texts.scss b/app/javascript/stylesheets/general/_custom_texts.scss new file mode 100644 index 00000000..d81d44f7 --- /dev/null +++ b/app/javascript/stylesheets/general/_custom_texts.scss @@ -0,0 +1,40 @@ +/* + This styles apply to custom texts defined in + /app/javascript/components/shared/CustomTexts.tsx +*/ + +.titleText { + @extend + .text-dark, + .font-weight-bolder; +} + +.mutedText { + @extend + .text-muted, + .text-center; +} + +.uppercaseText { + @extend + .text-secondary, + .text-uppercase, + .font-weight-lighter; +} + +.successText { + @extend + .text-success, + .text-center; +} + +.dangerText { + @extend + .text-danger, + .text-center; +} + +.descriptionText { + @extend + .text-muted; +} \ No newline at end of file diff --git a/app/javascript/stylesheets/main.scss b/app/javascript/stylesheets/main.scss index 22a96369..1db06dc3 100644 --- a/app/javascript/stylesheets/main.scss +++ b/app/javascript/stylesheets/main.scss @@ -1,12 +1,16 @@ @import 'vendors/bootstrap_custom'; -@import 'general/index'; -@import 'general/navbar'; +@import 'general/custom_texts'; @import 'general/form'; @import 'general/icons'; +@import 'general/index'; +@import 'general/navbar'; /* Components stylesheets are not imported here. Instead, they are imported in the specific React components that use them -*/ \ No newline at end of file +*/ +@import 'components/Board'; +@import 'components/Post'; +@import 'components/Roadmap'; \ No newline at end of file