-
Notifications
You must be signed in to change notification settings - Fork 1
Dev #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sjumba
wants to merge
73
commits into
master
Choose a base branch
from
dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dev #17
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 4ec4ddd
Merge branch 'master' of https://github.com/CastelloDev/SvgWebsite in…
Andileh 02815fd
missing import
Andileh fd8eeb5
conflict
74e9a17
changes done
7f4d391
changes
5675695
display svg by data url functionality after being optimised
sjumba ff7260d
my change request attended
sjumba c23d351
restructured code as per change request
sjumba c1f2ff8
cleaning up code
sjumba 702c929
gave more meaningful words
sjumba 94c4e25
naming and removal of unused variables
sjumba 5741ff1
renamed a function
sjumba 89bf1b5
added bibel
sjumba 2cddbe7
renaming, explained code, removed - change requests
sjumba f41db4c
change requests, renaming, removing & answering questions
sjumba fa0d433
removed Array.isArray
sjumba 9adf29f
renaming of values
sjumba 090f19f
pr attendant
sjumba ce0cc23
fixed barbel package with version 10.0.2
sjumba f9208a2
hover effect and mark with pink when clicked
sjumba 63bbfa7
wrap path with <a> to detect which path to change.
sjumba 339e413
Ïts hovering some parts with minor errors
sjumba d5e1e23
does not change the whole svg, its only changes path lines and leave …
sjumba 20539fd
It hovers path and ellipse
sjumba d6077a6
hovering for rect,
sjumba dff8986
it does change the svg colour into a specified colour, but when click…
sjumba f396227
after changing colour its cant undo
sjumba c6d6b39
does edit svg and downloads them into your own directory
sjumba 95b8af5
displaying and style improved
sjumba 1aace41
changing of colours is done and slightly styled
sjumba ce46ff2
styling loader
sjumba 4a291c3
2019/10/23 - stable state
sjumba c658dd9
optimised svg display refresh
sjumba ea42fb8
com
sjumba 8e5b296
recovered functioning app which hovers, changes and download svgs
sjumba 2b99b93
can now display well, highlight, changes on click and download with d…
sjumba 4cd152a
renames and applied ES6 where possible for readability
sjumba f68ff08
renamed a function doSomething to meaningful
sjumba 5d2975a
typo divider changed
sjumba 66eb1d9
renamed class name into small letters
sjumba 9b607db
renmoved the outer div which was not neccessary
sjumba 9efa0c7
removed -ves in styling, renamed className-1 ,removed file dependenc…
sjumba 3f52709
renamed home-display-class
sjumba 725a44a
removed reactstrap from dependencies and imports
sjumba 3c45694
removed bootstrap : 4.3.1
sjumba a1619a6
removed simple-svg-tools and other dependencies
sjumba 6c4e042
redux in displayAllComponent corrected
sjumba 7960e43
console.log removed
sjumba 2394d50
redux issue fixed , only calling what will be used
sjumba c893cfb
used let, removed some styling
sjumba c913a17
all margins removed, unused reduced not extracted, used padding inste…
sjumba a07c386
handled the case of nulls, visited all file where I would be possible…
sjumba 99f64e7
removed redirect and wrote it as a single line usin ES6, terminated a…
sjumba ecb9ed6
I have changed border-radius to be 25px
sjumba cc69832
I have deleted the png download button, was selected by a mistake
sjumba 3619df5
more request attended
sjumba dcab3d1
I have applied array.findIndex in svgSetting and checkBoxSelection
sjumba 16c2498
removed unused function toChangePluginObjectValues
sjumba 20f5cc9
renamed var t and used let instead of var ,naming of IndexOf
sjumba b2bce0a
changed var to be let ,removed initialisation of IndexOf, lower case …
sjumba e36ffc0
removed constants
sjumba 2182747
removed unused classname
sjumba ff5b6bb
()=>
sjumba b46bf32
used immutable functions to update props and reducers
sjumba bf4c709
fixed downloadNaming, if-else that were the same,asigning to a prop
sjumba 385df7b
spread have been used, no more overriding
sjumba 68030bc
replaced filter with map
sjumba 0f75478
shortened the optimisation function
sjumba e391b41
cleared console warnings
sjumba dcd2cca
made the code more readable - by using spread
sjumba 62ea40c
shortened the code for readabilty by spread
sjumba 62d5485
fixed display optimised that was an unkown value
sjumba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| } | ||
| }; | ||
|
|
||
| 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); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.