Skip to content

Commit

Permalink
Merge pull request #399 from SparkEdUAB/remove_slider
Browse files Browse the repository at this point in the history
Remove slider
  • Loading branch information
OlivierJM authored Sep 21, 2020
2 parents 7a1e973 + 59948d3 commit 0de1348
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 55 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ settings.json
# config.json
.deploy/
.vscode/
config.json
6 changes: 3 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "SparkEd Institute",
"tag": "Education",
"isUserAuth": true,
"name": "Inspired",
"tag": "To Inspire",
"isUserAuth": false,
"isHighSchool": false,
"isConfigured": true,
"server": "http://localhost:3000"
Expand Down
23 changes: 6 additions & 17 deletions imports/ui/components/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ import { _Courses } from '../../api/courses/courses';
import { _Units } from '../../api/units/units';
import Courses from './content/Courses.jsx';
import { FloatingButton } from './Utilities/Utilities.jsx';
import ImgSlider from "../components/layouts/ImageSlider"; // eslint-disable-line
import * as Config from '../../../config.json';
import { Loader } from "./Loader"; // eslint-disable-line
import ErrorBoundary from "./ErrorBoundary"; // eslint-disable-line
import { ThemeContext } from "../containers/AppWrapper"; // eslint-disable-line

export class Home extends PureComponent {
componentDidMount() {
Expand All @@ -24,32 +22,25 @@ export class Home extends PureComponent {
}

renderCourses() {
let index = 0;
const { courses } = this.props;
if (!courses) {
return <span> No Courses </span>;
} else if (courses.length === 0) {
return <p className="center"> There is no content as yet </p>;
}
return courses.map(cours => <Courses key={index++} course={cours} />);
return courses.map(cours => <Courses key={cours._id} course={cours} />);
}

render() {
const { courseReady } = this.props;

const { courseReady, courses } = this.props;
return (
<ErrorBoundary>
<ThemeContext.Consumer>
{({ state }) => (
<Fragment>
<ImgSlider isDark={state.isDark} />
<div className="container ">
<div className={`container ${!courseReady || !courses.length ? 'center-page' : ''}`}>
<div className="row ">
<div className="input-field col s12">
<div className={`input-field col s12`}>
<select
onChange={e => {
Session.set('language', e.target.value);
}}
onChange={e => Session.set('language', e.target.value)}
>
<option value="" disabled defaultValue>
Choose your Language
Expand All @@ -64,11 +55,9 @@ export class Home extends PureComponent {
<div className="row ">
{courseReady ? this.renderCourses() : <Loader />}
</div>
<FloatingButton />
</div>
<FloatingButton />
</Fragment>
)}
</ThemeContext.Consumer>
</ErrorBoundary>
);
}
Expand Down
2 changes: 1 addition & 1 deletion imports/ui/components/Search/SearchPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function SearchPage() {
return FlowRouter.go(`/results?q=${value}`);
}
return (
<div className="search-page">
<div className="center-page">
<form
action={'/results'}
onSubmit={handleSubmit}
Expand Down
8 changes: 2 additions & 6 deletions imports/ui/components/Search/searchpage.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
.search-page {
.center-page {
position: absolute;
/* margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0; */
width: 70%;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font-size: 30px;
}

input[type="text"] {
font-size: 30px;
}
34 changes: 15 additions & 19 deletions imports/ui/components/Utilities/Utilities.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,18 @@ export function setActiveItem(id, items, clas) {

// todo: make a proper component for the floating button and remove jQuery
export class FloatingButton extends PureComponent {
constructor(props) {
super(props);
this.state = {
isOpen: false,
modalIdentifier: '',
modalType: '',
title: '',
confirm: '',
reject: '',
value: '',
feedDesc: '',
feedTitle: '',
bookTitle: '',
bookDesc: '',
};
state = {
isOpen: false,
modalIdentifier: '',
modalType: '',
title: '',
confirm: '',
reject: '',
value: '',
feedDesc: '',
feedTitle: '',
bookTitle: '',
bookDesc: '',
}

componentDidMount() {
Expand All @@ -148,7 +145,6 @@ export class FloatingButton extends PureComponent {
const { pathname, href } = window.location;
switch (modalType) {
case 'feedback':
// const { href } = window.location;
Meteor.call(
'feedback.insert',
feedTitle,
Expand Down Expand Up @@ -232,6 +228,7 @@ export class FloatingButton extends PureComponent {
});
}

// refactor this
grabText = ({ target: { value } }, field) => {
switch (field) {
case 'feedTitle':
Expand Down Expand Up @@ -364,12 +361,11 @@ export class FloatingButton extends PureComponent {
</MainModal>

<div className="fixed-action-btn plus-icon">
<a
href=""
<span
className="btn-floating btn-large waves-effect waves-light teal darken-1"
>
<i className="fa fa-plus center more-items" />
</a>
</span>
<ul>
<li>
<a
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0de1348

Please sign in to comment.