diff --git a/src/App.css b/src/App.css index 06907a89..3bdf4d02 100644 --- a/src/App.css +++ b/src/App.css @@ -1,13 +1,12 @@ .App { text-align: center; font-family: Arial, Helvetica, sans-serif; - background-color: #F6F6F6; } .centered-tabs > nav { display: flex; flex-direction: row; - justify-content: center; + /* justify-content: center; */ } textarea { @@ -26,6 +25,14 @@ textarea { padding-top: 10px; } +.search-accent { + outline: solid !important; + outline-width: 4px !important; + outline-color: #68D0F4 !important; + border-radius: 4px; + padding: 0; +} + .main-search-bar { display: inline-block; padding-top: 8px; @@ -74,6 +81,7 @@ textarea { .metriq-header { margin-top: 16px; font-family: 'Arial', sans-serif; + color: #04165D } .metriq-navbar h2 { @@ -110,7 +118,7 @@ textarea { .nav-tabs { display: flex; flex-direction: row; - justify-content: center; + /* justify-content: center;*/ } .metriq-navbar-spacer { @@ -158,6 +166,8 @@ textarea { #metriq-main-content { min-height: 700px; padding-top: 20px; + padding-left: 32px; + padding-right: 32px; } @keyframes App-logo-spin { @@ -213,15 +223,39 @@ form > span > .row > label { padding: 12px; } +.view-header { + color: #04165D +} + +.task { + padding: 32px; + box-shadow: 0 3px 12px rgba(33,33,33,.2); +} + +.submission-cell { + padding: 8px; + min-width: 256px; +} + .submission { - border-radius: 16px; - margin: 6px; padding: 8px; + margin: 6px; background-color: #FFFFFF; } .submission:hover { - box-shadow: 0 0 16px rgba(33,33,33,.2); + box-shadow: 0 3px 16px rgba(33,33,33,.2); +} + +.submission-large { + border-radius: 16px; + box-shadow: 0 3px 12px rgba(33,33,33,.2); +} + +.category-item-box { + display: inline-block; + height: 128px; + padding: 12px; } .delete-button { @@ -266,6 +300,27 @@ form > span > .row > label { padding: 8px; } +.submission-image-small { + display: inline-block; + vertical-align: -40px; + width: 60px; + height: auto; + max-width: 120px; + max-height: 120px; + padding-top: 16px; + padding-bottom: 16px; +} + +.submission-heading-small { + padding-top: 16px; + padding-bottom: 16px; +} + +.top-submitters-card { + padding: 8px 16px 8px 16px; + box-shadow: 0 3px 12px rgba(33,33,33,.2); +} + .submission-detail-image { display: inline-block; vertical-align: -128px; @@ -307,6 +362,17 @@ form > span > .row > label { text-align: left; } +.category-item-icon { + width: 22%; + display: inline-block; + padding-left: 24px; +} + +.platforms-more-button { + background-color: #68D0F4; + margin-left: 24px; +} + .edit-button { width: 80px; height: 40px; @@ -351,7 +417,7 @@ form > span > .row > label { color: white; } -.container .submission a { +.submission a { color: #000000; text-decoration: none; } @@ -378,6 +444,12 @@ form > span > .row > label { width: 100%; } +.sota-preview { + display: inline-block; + height: 256px; + width: 256px; +} + iframe { display: block; border-style:none; diff --git a/src/App.js b/src/App.js index ab6e647a..d77c9ecd 100644 --- a/src/App.js +++ b/src/App.js @@ -4,7 +4,7 @@ import SimpleReactFooter from './components/simple-react-footer/SimpleReactFoote const App = () =>
- + { exact path='/' > - + - + - + - + - + { } + render={(p) => } /> } + render={(p) => } /> } + render={(p) => } /> } + render={(p) => } /> { } const CategoryItemBox = (props) => { - const history = useHistory() - const [isSubscribed, setIsSubscribed] = useState(props.item.isSubscribed) - - const handleLoginRedirect = (type) => { - if (type === 'tag') { - history.push('/Login/Tags') - } else if (type === 'task') { - history.push('/Login/Tasks') - } else if (type === 'method') { - history.push('/Login/Methods') - } else if (type === 'platform') { - history.push('/Login/Platforms') - } - } - - const handleSubscribe = () => { - if (props.isLoggedIn) { - axios.post(config.api.getUriPrefix() + '/' + props.type + '/' + (props.type === 'tag' ? encodeURIComponent(props.item.name) : props.item.id) + '/subscribe', {}) - .then(res => { - if (props.type === 'tag') { - setIsSubscribed(res.data.data) - } else { - setIsSubscribed(!!res.data.data.isSubscribed) - } - }) - .catch(err => { - window.alert('Error: ' + ErrorHandler(err) + '\nSorry! Check your connection and login status, and try again.') - }) - } else { - handleLoginRedirect(props.type) - } - } - return ( - - -
-
- - {props.type !== 'tag' && props.item.description && -
-
- {props.item.name} - {props.type === 'task' && qedcIds.includes(parseInt(props.item.id)) && - (QED-C)} -
-
{renderLatex(props.item.description)}
-
} - {(props.type === 'tag' || !props.item.description) && -
{props.item.name}
} - -
-
- -
- - - -
- - +
+
+ + {props.type !== 'tag' && props.item.description && +
+
+ {props.item.name} + {props.type === 'task' && qedcIds.includes(parseInt(props.item.id)) && + (QED-C)} +
+
{renderLatex( + !props.item.description + ? '' + : ((!props.isPreview && (props.item.description.length > 128)) + ? (props.item.description.substring(0, 125) + '...') + : props.item.description))} +
+
} + {(props.type === 'tag' || !props.item.description) && +
{props.item.name}
} + +
+ + {!props.isPreview && + + + + + } +
+
) } diff --git a/src/components/CategoryItemIcon.js b/src/components/CategoryItemIcon.js index 5912e74d..5e525cb9 100644 --- a/src/components/CategoryItemIcon.js +++ b/src/components/CategoryItemIcon.js @@ -3,10 +3,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import TooltipTrigger from './TooltipTrigger' const CategoryItemIcon = (props) => -
- -
{props.count}
-
-
+ +
{props.count}
+
export default CategoryItemIcon diff --git a/src/components/CategoryScroll.js b/src/components/CategoryScroll.js index 2ad76088..14f71312 100644 --- a/src/components/CategoryScroll.js +++ b/src/components/CategoryScroll.js @@ -1,35 +1,49 @@ -import React, { Suspense } from 'react' +import React, { Suspense, useEffect, useState } from 'react' import FormFieldWideRow from './FormFieldWideRow' const CategoryItemBox = React.lazy(() => import('./CategoryItemBox')) -const CategoryScroll = (props) => -
-
- {props.heading && +const CategoryScroll = (props) => { + const [rows, setRows] = useState([]) + + useEffect(() => { + const rws = [] + for (let i = 0; i < props.items.length / 3; ++i) { + const row = [] + for (let j = 0; j < 3; ++j) { + if ((3 * i + j) >= props.items.length) { + break + } + row.push(props.items[3 * i + j]) + } + rws.push(row) + } + setRows(rws) + }, [props.items]) + + return ( +
+
+ {props.heading && + +

{props.heading}

+
} - {props.heading} - } - - {!props.items.length && + {!props.items.length && (props.isLoading ?

Fetching items from server...

:

There are no approved items, yet.

)} - {(props.items.length > 0) && - Loading...
}> -
+ {(props.items.length > 0) && + Loading...
}>
-
- - - {props.items.map((item, index) => )} - -
+
+ {rows.map((row, rid) =>
{row.map((item, id) => )}
)}
-
- } - -
-
+ } + +
+
+ ) +} export default CategoryScroll diff --git a/src/components/FormFieldTypeaheadRow.js b/src/components/FormFieldTypeaheadRow.js index cfffd6b7..57a80b75 100644 --- a/src/components/FormFieldTypeaheadRow.js +++ b/src/components/FormFieldTypeaheadRow.js @@ -61,7 +61,7 @@ const FormFieldTypeaheadRow = (props) => { } - {props.label && !props.tooltip && + {(props.isRow || (props.label && !props.tooltip)) &&