Skip to content
Open

Dev #17

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
7fac6d2
displayAllComponent in one component.If checkBox is selected add to s…
Andileh Sep 16, 2019
4ec4ddd
Merge branch 'master' of https://github.com/CastelloDev/SvgWebsite in…
Andileh Sep 16, 2019
02815fd
missing import
Andileh Sep 16, 2019
fd8eeb5
conflict
Sep 16, 2019
74e9a17
changes done
Sep 17, 2019
7f4d391
changes
Sep 18, 2019
5675695
display svg by data url functionality after being optimised
sjumba Sep 30, 2019
ff7260d
my change request attended
sjumba Sep 30, 2019
c23d351
restructured code as per change request
sjumba Sep 30, 2019
c1f2ff8
cleaning up code
sjumba Sep 30, 2019
702c929
gave more meaningful words
sjumba Sep 30, 2019
94c4e25
naming and removal of unused variables
sjumba Sep 30, 2019
5741ff1
renamed a function
sjumba Sep 30, 2019
89bf1b5
added bibel
sjumba Sep 30, 2019
2cddbe7
renaming, explained code, removed - change requests
sjumba Oct 1, 2019
f41db4c
change requests, renaming, removing & answering questions
sjumba Oct 1, 2019
fa0d433
removed Array.isArray
sjumba Oct 1, 2019
9adf29f
renaming of values
sjumba Oct 1, 2019
090f19f
pr attendant
sjumba Oct 1, 2019
ce0cc23
fixed barbel package with version 10.0.2
sjumba Oct 2, 2019
f9208a2
hover effect and mark with pink when clicked
sjumba Oct 3, 2019
63bbfa7
wrap path with <a> to detect which path to change.
sjumba Oct 8, 2019
339e413
Ïts hovering some parts with minor errors
sjumba Oct 9, 2019
d5e1e23
does not change the whole svg, its only changes path lines and leave …
sjumba Oct 10, 2019
20539fd
It hovers path and ellipse
sjumba Oct 10, 2019
d6077a6
hovering for rect,
sjumba Oct 10, 2019
dff8986
it does change the svg colour into a specified colour, but when click…
sjumba Oct 15, 2019
f396227
after changing colour its cant undo
sjumba Oct 15, 2019
c6d6b39
does edit svg and downloads them into your own directory
sjumba Oct 17, 2019
95b8af5
displaying and style improved
sjumba Oct 21, 2019
1aace41
changing of colours is done and slightly styled
sjumba Oct 22, 2019
ce46ff2
styling loader
sjumba Oct 22, 2019
4a291c3
2019/10/23 - stable state
sjumba Oct 23, 2019
c658dd9
optimised svg display refresh
sjumba Oct 31, 2019
ea42fb8
com
sjumba Nov 6, 2019
8e5b296
recovered functioning app which hovers, changes and download svgs
sjumba Nov 6, 2019
2b99b93
can now display well, highlight, changes on click and download with d…
sjumba Nov 6, 2019
4cd152a
renames and applied ES6 where possible for readability
sjumba Nov 6, 2019
f68ff08
renamed a function doSomething to meaningful
sjumba Nov 7, 2019
5d2975a
typo divider changed
sjumba Nov 7, 2019
66eb1d9
renamed class name into small letters
sjumba Nov 7, 2019
9b607db
renmoved the outer div which was not neccessary
sjumba Nov 7, 2019
9efa0c7
removed -ves in styling, renamed className-1 ,removed file dependenc…
sjumba Nov 7, 2019
3f52709
renamed home-display-class
sjumba Nov 7, 2019
725a44a
removed reactstrap from dependencies and imports
sjumba Nov 7, 2019
3c45694
removed bootstrap : 4.3.1
sjumba Nov 7, 2019
a1619a6
removed simple-svg-tools and other dependencies
sjumba Nov 7, 2019
6c4e042
redux in displayAllComponent corrected
sjumba Nov 7, 2019
7960e43
console.log removed
sjumba Nov 7, 2019
2394d50
redux issue fixed , only calling what will be used
sjumba Nov 7, 2019
c893cfb
used let, removed some styling
sjumba Nov 8, 2019
c913a17
all margins removed, unused reduced not extracted, used padding inste…
sjumba Nov 8, 2019
a07c386
handled the case of nulls, visited all file where I would be possible…
sjumba Nov 8, 2019
99f64e7
removed redirect and wrote it as a single line usin ES6, terminated a…
sjumba Nov 11, 2019
ecb9ed6
I have changed border-radius to be 25px
sjumba Nov 11, 2019
cc69832
I have deleted the png download button, was selected by a mistake
sjumba Nov 11, 2019
3619df5
more request attended
sjumba Nov 11, 2019
dcab3d1
I have applied array.findIndex in svgSetting and checkBoxSelection
sjumba Nov 11, 2019
16c2498
removed unused function toChangePluginObjectValues
sjumba Nov 11, 2019
20f5cc9
renamed var t and used let instead of var ,naming of IndexOf
sjumba Nov 11, 2019
b2bce0a
changed var to be let ,removed initialisation of IndexOf, lower case …
sjumba Nov 12, 2019
e36ffc0
removed constants
sjumba Nov 12, 2019
2182747
removed unused classname
sjumba Nov 12, 2019
ff5b6bb
()=>
sjumba Nov 12, 2019
b46bf32
used immutable functions to update props and reducers
sjumba Nov 12, 2019
bf4c709
fixed downloadNaming, if-else that were the same,asigning to a prop
sjumba Nov 13, 2019
385df7b
spread have been used, no more overriding
sjumba Nov 13, 2019
68030bc
replaced filter with map
sjumba Nov 13, 2019
0f75478
shortened the optimisation function
sjumba Nov 13, 2019
e391b41
cleared console warnings
sjumba Nov 14, 2019
dcd2cca
made the code more readable - by using spread
sjumba Nov 14, 2019
62ea40c
shortened the code for readabilty by spread
sjumba Nov 14, 2019
62d5485
fixed display optimised that was an unkown value
sjumba Nov 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"react-router-dom": "5.0.1",
"react-scripts": "3.1.1",
"redux": "4.0.4",
"simple-svg-icons": "2.0.2",
"simple-svg-tools": "1.1.12"
"svg-inline-react": "3.2.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
4 changes: 4 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import NavBar from './components/NavBar/NavBar';
import ReduxDemo from './components/ReduxDemo/ReduxDemo';
import mainReducer from './store/mainReducer';
import SvgSettingOptions from './components/svgSetting/svgSettingOptions';
import DisplayAllComponent from './components/displayAllComponent';
import FinalSvgDisplay from './components/displaySvg/finalSvgDisplay';
import './App.scss';
class App extends Component {
render() {
Expand All @@ -23,6 +25,8 @@ class App extends Component {
<Route path='/displaySvg' component={DisplaySvg} />
<Route path='/reduxdemo' component={ReduxDemo} />
<Route path='/svgSettingOptions' component={SvgSettingOptions} />
<Route path='/FinalSvgDisplay' component={FinalSvgDisplay} />
<Route path='/' component={DisplayAllComponent} />
</Switch>
</div>
</BrowserRouter>
Expand Down
2 changes: 1 addition & 1 deletion src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
color: #FFFFFF;
}

.App-link {
Expand Down
48 changes: 24 additions & 24 deletions src/components/NavBar/NavBar.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import React, { Component } from "react";
import { Link } from "react-router-dom";

import './NavBar.scss';
import "./NavBar.scss";

export default class NavBar extends Component {
render() {
return (
<div className={'navbar'}>
<Link to='/'>
<div>{'Home'}</div>
</Link>
<div>{' | '}</div>
<Link to='/choosefile'>
<div>{'Choose File'}</div>
</Link>
<div>{' | '}</div>
<Link to='/displaySvg'>
<div>{'Display Svg'}</div>
</Link>
<div>{' | '}</div>
<Link to='/reduxdemo'>
<div>{'Redux Demo'}</div>
</Link>
</div>
);
}
render() {
return (
<div className={"navbar"}>
<Link to="/">
<div>{"Home"}</div>
</Link>
<div className="navbar-divider">{" | "}</div>
<Link to="/choosefile">
<div>{"Choose File"}</div>
</Link>
<div className="navbar-divider">{" | "}</div>
<Link to="/displaySvg">
<div>{"Display Svg"}</div>
</Link>
<div className="navbar-divider">{" | "}</div>
<Link to="/reduxdemo">
<div>{"Redux Demo"}</div>
</Link>
</div>
);
}
}
6 changes: 5 additions & 1 deletion src/components/NavBar/NavBar.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.navbar{
display: flex;
height: 30px;
height: 105px;
background-color: #bcda12;
align-items: center;

Expand All @@ -12,4 +12,8 @@
a:hover{
background-color: #abc514;
}
}

.navbar-divider{
font-size: 59px;
}
2 changes: 1 addition & 1 deletion src/components/ReduxDemo/ReduxDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ const mapDispatchToProps = dispatch => {
};
};

export default connect(mapStateToProps, mapDispatchToProps)(ReduxDemo);
export default connect(mapStateToProps, mapDispatchToProps)(ReduxDemo);
132 changes: 94 additions & 38 deletions src/components/checkBoxSelection/checkBoxSelection.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,103 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './checkBoxSelection.scss';
import React, { Component } from "react";
import PropTypes from "prop-types";
import "./checkBoxSelection.scss";
import { connect } from "react-redux";
import {
ADD_VARIABLE,
UPDATE_VARIABLE,
DELETE_VARIABLE
} from "../../store/actionTypes";

class CheckBoxSelection extends Component {
constructor(props) {
super(props);
this.state = {
isClicked: false
};
constructor(props) {
super(props);
this.state = {
isClicked: this.props.isSelected
};
}

convertSvgToDataUrl = file => {
let reader = new FileReader();
const svgSettings = [...this.props.svgSettingList];
reader.onload = result => {

svgSettings.push({
name: file.name,
dataurl: result.target.result
});
this.props.updateStore("svgSettingList",svgSettings)

};
if (file) {
reader.readAsDataURL(file);
}
};

componentWillMount() {
this.setState({ isClicked: this.props.isSelected });
changeColourAndTick = () => {

this.setState({ isClicked: !this.state.isClicked });
let index = this.props.svgSettingList.findIndex(
setting => setting.name == this.props.file.name
);

if (index < 0) {
this.convertSvgToDataUrl(this.props.file);
} else {
this.props.svgSettingList.splice(index, 1);
Comment thread
CastelloDev marked this conversation as resolved.
}
};

handleDivClick= () => {
this.setState({
isClicked: !this.state.isClicked
});
}

render() {

return (

<div
className={this.state.isClicked ? 'checkbox-container-clicked' : 'checkbox-container-unclicked'}
onClick={this.handleDivClick}
>
<input
className='checkbox-input'
type='checkbox'
checked={this.state.isClicked}
/>
<label className='checkbox-label'>
{this.props.filename}
</label>
</div>
);
}
render() {
return (
<div
className={
this.state.isClicked
? "checkbox-container-clicked"
: "checkbox-container-unclicked"
}
onClick={()=>this.changeColourAndTick()}
>
<input
className="checkbox-input"
type="checkbox"
checked={this.state.isClicked}
/>
<label className="checkbox-label">{this.props.filename}</label>
</div>
);
}
}

CheckBoxSelection.propTypes = {
filename: PropTypes.string,
isSelected: PropTypes.bool
svgSettingList: PropTypes.array,
filename: PropTypes.string
};
export default CheckBoxSelection;

const mapStateToProps = state => {
const svgSettingList = state.svgSettingList;
return { svgSettingList };
};

const mapDispatchToProps = dispatch => {
return {
addToStore: (variableName, variableValue) =>
dispatch({
type: ADD_VARIABLE,
variableName: variableName,
variableValue: variableValue
}),
updateStore: (variableName, variableValue) =>
dispatch({
type: UPDATE_VARIABLE,
variableName: variableName,
variableValue: variableValue
}),
deleteFromStore: variableName =>
dispatch({ type: DELETE_VARIABLE, variableName: variableName })
};
};

export default connect(
mapStateToProps,
mapDispatchToProps
)(CheckBoxSelection);
65 changes: 41 additions & 24 deletions src/components/checkBoxSelection/checkBoxSelection.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
.checkbox-container-clicked {
background-color: yellow;
width: 80%;
height: 10%;
background-color: #b5cfe1;
}

.checkbox-container-unclicked {
background-color: white;
width: 80%;
height: 10%;
border: 1px solid black;
background-color: #FFFFFF;
border: 1px solid #000000;
}

.checkbox-input,
.checkbox-label {
margin-top: 12%;
margin-left: 12%;
}

.checkbox-input-svg,
.checkbox-label-svg {
margin-top: 2%;
margin-left: 2%;
padding-left: 3%;
}

.main {
Expand All @@ -29,24 +20,50 @@

.file {
display: flex;
margin-top: 20px;
padding: 2%;
}

.hide-file-list {
margin-top: 20px;
display: none;
}

.card-settings {
height: 600px;
height: 350px;
overflow-y: scroll;
background-color:#b5cfe1 ;
width: 600px;
}

.home-display {
display: flex;
}
.choose {
width: 50%;
}
.display {
width: 50%;
}

.optimize-button{
text-align: center;
display: inline-block;
justify-items: center;
width:100px;
height: 70px;
border-radius: 25px;
background-color: #b5cfe1;
width: 350px;
padding-left: 20px;
box-shadow: 10px 10px 55px 0px black;
align-items: center;
}

.download-button {
height: 70px;
border-radius: 35px;
Comment thread
CastelloDev marked this conversation as resolved.
background-color: #b6e1b5;
position: fixed;
}
.optimise-button-div{
display: flex;
justify-content: center;

.slider {
margin-top: 10px;
margin-bottom: 10px;
}


Loading