getMousePosition(event) }
- onClick={ () => setTriggerValue( parseInt(cursorValue) ) }
- style={ { width: exchange.candles.candlesCount * 15 + 'px' } }>
- { user.id > -1 ? (
+ onMouseOver={event => getMousePosition(event)}
+ onClick={() => setTriggerValue(parseInt(cursorValue))}
+ style={{ width: exchange.candles.candlesCount * 15 + 'px' }}>
+ {user.id > -1 ? (
-
{ parseInt(cursorValue) } PLN
+ style={{ transform: 'translateY(' + (mousePosition.y - 175) + 'px)' }}>
+
{parseInt(cursorValue)} PLN
+ style={{ transform: 'translateX(' + (mousePosition.x) + 'px)' }}>
) : (
-
- ) }
- { exchange.candles.candles.map( (candle, key) => {
+
+ )}
+ {exchange.candles.candles.map((candle, key) => {
- const color = candle.Open > candle.Close ? colorRed.background : colorGreen.background
+ const color = candle.Open > candle.Close ? colorRed.background : colorGreen.background
- let highValue = candle.Open > candle.Close ? candle.Open : candle.Close
- let lowValue = candle.Open < candle.Close ? candle.Open : candle.Close
+ let highValue = candle.Open > candle.Close ? candle.Open : candle.Close
+ let lowValue = candle.Open < candle.Close ? candle.Open : candle.Close
- let scaleProperties = 10
+ let scaleProperties = 10
- let chartScaleY = (exchange.candles.graphMax - candle.Max) / pixelScale
+ let chartScaleY = (exchange.candles.graphMax - candle.Max) / pixelScale
- let onePercentScaleY = 100 / chartScaleY
- let difference = ( highValue - lowValue ) / pixelScale
+ let onePercentScaleY = 100 / chartScaleY
+ let difference = (highValue - lowValue) / pixelScale
- if ( parseInt(difference) === 0 )
- difference = 1
+ if (parseInt(difference) === 0)
+ difference = 1
- return (
+ return (
+
getCandleInformation(candle)}>
+
+
getCandleInformation(candle) }>
-
-
-
+ className='candle'
+ style={{ paddingTop: chartScaleY + 'px' }}>
+
-
-
- )
- }
+
+
+
+
+
)
}
+ )
+ }
-
-1 ? 'exchangeInterface' : 'exchangeEmptySpace' }>
+
-1 ? 'exchangeInterface' : 'exchangeEmptySpace'}>
-
Open: { candleInfo.Open } PLN,
-
Close: { candleInfo.Close } PLN,
-
Max: { candleInfo.Max } PLN,
-
Min: { candleInfo.Min } PLN,
-
Volume: { candleInfo.Vol },
-
Date: { candleInfo.Date }
+
Open: {candleInfo.Open} PLN
+
Close: {candleInfo.Close} PLN
+
Max: {candleInfo.Max} PLN
+
Min: {candleInfo.Min} PLN
+
Volume: {candleInfo.Vol}
+
Date: {candleInfo.Date}
- { user.id > -1 ? (
-
-
-
-
-
- ) : (
-
- )
- }
+ {user.id > -1 ? (
+
+
+
+
+
+ ) : (
+
+ )
+ }
)
}
@@ -158,10 +168,10 @@ const mapStateToProps = state => ({
})
const mapDispatchToProps = dispatch => ({
- getChart: exchange => dispatch( getChart(exchange) ),
- getUserTriggers: exchange => dispatch( getUserTriggers(exchange) ),
- getUserNotifications: exchange => dispatch( getUserNotifications(exchange) ),
- getUserTransactions: exchange => dispatch( getUserTransactions(exchange) )
+ getChart: exchange => dispatch(getChart(exchange)),
+ getUserTriggers: exchange => dispatch(getUserTriggers(exchange)),
+ getUserNotifications: exchange => dispatch(getUserNotifications(exchange)),
+ getUserTransactions: exchange => dispatch(getUserTransactions(exchange))
})
-export default connect(mapStateToProps,mapDispatchToProps)(IndexExchange)
+export default connect(mapStateToProps, mapDispatchToProps)(IndexExchange)
diff --git a/src/components/forum/forumCommentUpdate.js b/src/components/forum/forumCommentUpdate.js
old mode 100644
new mode 100755
index f2b2016..4cdf0fb
--- a/src/components/forum/forumCommentUpdate.js
+++ b/src/components/forum/forumCommentUpdate.js
@@ -16,7 +16,15 @@ const ForumCommentUpdate = ({
const updateCommentTextArea = React.createRef()
- const updateOldComment = (event) => {
+ const sleep = (ms) => {
+ return new Promise(resolve => setTimeout(resolve, ms))
+ }
+
+ let subjectLoad = {
+ id: subjects.actualSubjectID
+ }
+
+ const updateOldComment = async (event) => {
event.preventDefault()
if ( updateCommentTextArea.current.value !== '' ) {
let commentData = {
@@ -25,7 +33,9 @@ const ForumCommentUpdate = ({
text: updateCommentTextArea.current.value
}
updateCommentTextArea.current.value = ''
- updateComment(commentData)
+ await updateComment(commentData)
+ await sleep(100)
+ await refreshSubjectComments(subjectLoad)
}
}
diff --git a/src/components/forum/forumComments.js b/src/components/forum/forumComments.js
old mode 100644
new mode 100755
index b2a4bf6..d6bbd5b
--- a/src/components/forum/forumComments.js
+++ b/src/components/forum/forumComments.js
@@ -23,7 +23,15 @@ const ForumComments = ({
const addCommentTextArea = React.createRef()
- const addNewComment = (event) => {
+ let subjectLoad = {
+ id: subjects.actualSubjectID
+ }
+
+ const sleep = (ms) => {
+ return new Promise(resolve => setTimeout(resolve, ms))
+ }
+
+ const addNewComment = async (event) => {
event.preventDefault()
if ( addCommentTextArea.current.value !== '' ) {
let newComment = {
@@ -33,25 +41,21 @@ const ForumComments = ({
token: user.token
}
addCommentTextArea.current.value = ''
- addComment(newComment)
+ await addComment( newComment )
+ await sleep(100)
+ await refreshSubjectComments(subjectLoad)
setFormDiv( !formDiv )
- let actualSubject = {
- id: subjects.actualSubjectID
- }
- refreshSubjectComments(actualSubject)
}
}
- const deleteOldComment = (commentID) => {
+ const deleteOldComment = async(commentID) => {
let delComment = {
id: commentID,
token: user.token
}
- deleteComment(delComment)
- let actualSubject = {
- id: subjects.actualSubjectID
- }
- refreshSubjectComments(actualSubject)
+ await deleteComment(delComment)
+ await sleep(100)
+ await refreshSubjectComments(subjectLoad)
}
const [commentText, setCommentText] = useState(0)
diff --git a/src/components/forum/forumRatings.js b/src/components/forum/forumRatings.js
old mode 100644
new mode 100755
index 53a3859..b8811bf
--- a/src/components/forum/forumRatings.js
+++ b/src/components/forum/forumRatings.js
@@ -57,21 +57,22 @@ const ForumRatings = ({
let divYPositionOnPage = ratingDiv.getBoundingClientRect().top + 72
let yPosition = event.screenY - divYPositionOnPage
- if ( yPosition > 200 ) {
+ if ( yPosition > 270 ) {
setValue(5)
}
- else if ( yPosition > 150 && yPosition < 200 ) {
+ else if ( yPosition > 215 && yPosition < 270 ) {
setValue(4)
}
- else if ( yPosition > 100 && yPosition < 150 ) {
+ else if ( yPosition > 168 && yPosition < 215 ) {
setValue(3)
}
- else if ( yPosition > 50 && yPosition < 150 ) {
+ else if ( yPosition > 120 && yPosition < 168 ) {
setValue(2)
}
- else if ( yPosition > 0 && yPosition < 50 ) {
+ else if ( yPosition > 60 && yPosition < 120 ) {
setValue(1)
}
+ console.log(yPosition)
}
const [updateRating, setUpdate] = useState(false)
diff --git a/src/components/forum/forumSubjectUpdate.js b/src/components/forum/forumSubjectUpdate.js
old mode 100644
new mode 100755
diff --git a/src/components/forum/forumSubjects.js b/src/components/forum/forumSubjects.js
old mode 100644
new mode 100755
index c86a138..0b07f22
--- a/src/components/forum/forumSubjects.js
+++ b/src/components/forum/forumSubjects.js
@@ -23,6 +23,7 @@ const ForumSubjects = ({
const addSubjectTitle = React.createRef()
const addSubjectComment = React.createRef()
+
const addNewSubject = (event) => {
event.preventDefault()
if ( addSubjectTitle.current.value !== '' && addSubjectComment.current.value !== '' ) {
diff --git a/src/components/forum/indexForum.js b/src/components/forum/indexForum.js
old mode 100644
new mode 100755
diff --git a/src/components/forum/indexForumUpdate.js b/src/components/forum/indexForumUpdate.js
old mode 100644
new mode 100755
diff --git a/src/components/indexInterface.js b/src/components/indexInterface.js
old mode 100644
new mode 100755
diff --git a/src/components/menuBar/menuBar.js b/src/components/menuBar/menuBar.js
old mode 100644
new mode 100755
diff --git a/src/components/useInterval.js b/src/components/useInterval.js
old mode 100644
new mode 100755
diff --git a/src/images/BtcLogo.png b/src/images/BtcLogo.png
old mode 100644
new mode 100755
diff --git a/src/images/ForumLogo.png b/src/images/ForumLogo.png
old mode 100644
new mode 100755
diff --git a/src/images/gatsby-astronaut.png b/src/images/gatsby-astronaut.png
old mode 100644
new mode 100755
diff --git a/src/images/gatsby-icon.png b/src/images/gatsby-icon.png
old mode 100644
new mode 100755
diff --git a/src/images/stockExchange.mp4 b/src/images/stockExchange.mp4
old mode 100644
new mode 100755
diff --git a/src/pages/index.js b/src/pages/index.js
old mode 100644
new mode 100755
diff --git a/src/stores/apiAddress.js b/src/stores/apiAddress.js
old mode 100644
new mode 100755
diff --git a/src/stores/chat/duck/actions.js b/src/stores/chat/duck/actions.js
old mode 100644
new mode 100755
diff --git a/src/stores/chat/duck/index.js b/src/stores/chat/duck/index.js
old mode 100644
new mode 100755
diff --git a/src/stores/chat/duck/operations.js b/src/stores/chat/duck/operations.js
old mode 100644
new mode 100755
diff --git a/src/stores/chat/duck/reducers.js b/src/stores/chat/duck/reducers.js
old mode 100644
new mode 100755
diff --git a/src/stores/chat/duck/types.js b/src/stores/chat/duck/types.js
old mode 100644
new mode 100755
diff --git a/src/stores/comments/duck/actions.js b/src/stores/comments/duck/actions.js
old mode 100644
new mode 100755
index 7de1f42..bb2970b
--- a/src/stores/comments/duck/actions.js
+++ b/src/stores/comments/duck/actions.js
@@ -4,6 +4,11 @@ const getRatingsComment = item => ({
type: types.GET_COMMENTS_RATINGS, item
})
+const addComment = item => ({
+ type: types.ADD_COMMENT, item
+})
+
export default {
- getRatingsComment
+ getRatingsComment,
+ addComment
}
diff --git a/src/stores/comments/duck/index.js b/src/stores/comments/duck/index.js
old mode 100644
new mode 100755
diff --git a/src/stores/comments/duck/operations.js b/src/stores/comments/duck/operations.js
old mode 100644
new mode 100755
diff --git a/src/stores/comments/duck/reducers.js b/src/stores/comments/duck/reducers.js
old mode 100644
new mode 100755
diff --git a/src/stores/comments/duck/types.js b/src/stores/comments/duck/types.js
old mode 100644
new mode 100755
index 66e1543..d9e6432
--- a/src/stores/comments/duck/types.js
+++ b/src/stores/comments/duck/types.js
@@ -1,5 +1,7 @@
const GET_COMMENTS_RATINGS = 'GET_COMMENTS_RATINGS'
+const ADD_COMMENT = 'ADD_COMMENT'
export default {
- GET_COMMENTS_RATINGS
+ GET_COMMENTS_RATINGS,
+ ADD_COMMENT
}
diff --git a/src/stores/exchange/duck/actions.js b/src/stores/exchange/duck/actions.js
old mode 100644
new mode 100755
diff --git a/src/stores/exchange/duck/index.js b/src/stores/exchange/duck/index.js
old mode 100644
new mode 100755
diff --git a/src/stores/exchange/duck/operations.js b/src/stores/exchange/duck/operations.js
old mode 100644
new mode 100755
diff --git a/src/stores/exchange/duck/reducers.js b/src/stores/exchange/duck/reducers.js
old mode 100644
new mode 100755
diff --git a/src/stores/exchange/duck/types.js b/src/stores/exchange/duck/types.js
old mode 100644
new mode 100755
diff --git a/src/stores/localStorage.js b/src/stores/localStorage.js
old mode 100644
new mode 100755
diff --git a/src/stores/movements/duck/actions.js b/src/stores/movements/duck/actions.js
old mode 100644
new mode 100755
diff --git a/src/stores/movements/duck/index.js b/src/stores/movements/duck/index.js
old mode 100644
new mode 100755
diff --git a/src/stores/movements/duck/reducers.js b/src/stores/movements/duck/reducers.js
old mode 100644
new mode 100755
diff --git a/src/stores/movements/duck/types.js b/src/stores/movements/duck/types.js
old mode 100644
new mode 100755
diff --git a/src/stores/reducers.js b/src/stores/reducers.js
old mode 100644
new mode 100755
diff --git a/src/stores/store.js b/src/stores/store.js
old mode 100644
new mode 100755
index cfcdd4f..86ef929
--- a/src/stores/store.js
+++ b/src/stores/store.js
@@ -11,7 +11,7 @@ const persistedState = loadState();
export const store = createStore(rootReducer, persistedState, composeWithDevTools(applyMiddleware(thunk)))
-console.log(store.getState())
+// console.log(store.getState())
store.subscribe(() => {
saveState({
diff --git a/src/stores/subjects/duck/actions.js b/src/stores/subjects/duck/actions.js
old mode 100644
new mode 100755
index 43b9dc7..339b6c8
--- a/src/stores/subjects/duck/actions.js
+++ b/src/stores/subjects/duck/actions.js
@@ -12,8 +12,13 @@ const deactivate = item => ({
type: types.DEACTIVATE, item
})
+const addComment = item => ({
+ type: types.ADD_COMMENT, item
+})
+
export default {
getSubjectComments,
activate,
- deactivate
+ deactivate,
+ addComment
}
diff --git a/src/stores/subjects/duck/index.js b/src/stores/subjects/duck/index.js
old mode 100644
new mode 100755
diff --git a/src/stores/subjects/duck/operations.js b/src/stores/subjects/duck/operations.js
old mode 100644
new mode 100755
diff --git a/src/stores/subjects/duck/reducers.js b/src/stores/subjects/duck/reducers.js
old mode 100644
new mode 100755
index f58292e..d2be0c6
--- a/src/stores/subjects/duck/reducers.js
+++ b/src/stores/subjects/duck/reducers.js
@@ -34,6 +34,11 @@ const subjectReducer = (state = INITIAL_STATE, action) => {
actualSubjectAuthorID: -1,
isActive: false
}
+ case types.ADD_COMMENT:
+ return {
+ ...state,
+ commentsList: [...state.commentsList, action.item]
+ }
default:
return state;
}
diff --git a/src/stores/subjects/duck/types.js b/src/stores/subjects/duck/types.js
old mode 100644
new mode 100755
index d6ce16d..c78a40b
--- a/src/stores/subjects/duck/types.js
+++ b/src/stores/subjects/duck/types.js
@@ -1,9 +1,11 @@
const GET_SUBJECT_COMMENTS = 'GET_SUBJECT_COMMENTS'
const ACTIVATE = 'ACTIVATE'
const DEACTIVATE = 'DEACTIVATE'
+const ADD_COMMENT = 'ADD_COMMENT'
export default{
GET_SUBJECT_COMMENTS,
ACTIVATE,
- DEACTIVATE
+ DEACTIVATE,
+ ADD_COMMENT
}
diff --git a/src/stores/threads/duck/actions.js b/src/stores/threads/duck/actions.js
old mode 100644
new mode 100755
diff --git a/src/stores/threads/duck/index.js b/src/stores/threads/duck/index.js
old mode 100644
new mode 100755
diff --git a/src/stores/threads/duck/operations.js b/src/stores/threads/duck/operations.js
old mode 100644
new mode 100755
diff --git a/src/stores/threads/duck/reducers.js b/src/stores/threads/duck/reducers.js
old mode 100644
new mode 100755
diff --git a/src/stores/threads/duck/types.js b/src/stores/threads/duck/types.js
old mode 100644
new mode 100755
diff --git a/src/stores/user/duck/actions.js b/src/stores/user/duck/actions.js
old mode 100644
new mode 100755
diff --git a/src/stores/user/duck/index.js b/src/stores/user/duck/index.js
old mode 100644
new mode 100755
diff --git a/src/stores/user/duck/operations.js b/src/stores/user/duck/operations.js
old mode 100644
new mode 100755
diff --git a/src/stores/user/duck/reducers.js b/src/stores/user/duck/reducers.js
old mode 100644
new mode 100755
diff --git a/src/stores/user/duck/types.js b/src/stores/user/duck/types.js
old mode 100644
new mode 100755
diff --git a/src/styles/elements.scss b/src/styles/elements.scss
old mode 100644
new mode 100755
diff --git a/src/styles/forumRatings.scss b/src/styles/forumRatings.scss
old mode 100644
new mode 100755
index 7ef130d..d5f87f9
--- a/src/styles/forumRatings.scss
+++ b/src/styles/forumRatings.scss
@@ -14,11 +14,14 @@ $widthRT: 40px;
width: 1px;
height: 250px;
- background-color: rgba(117,82,29,1);
+ border: solid 1px;
+ border-color: rgba(117,82,29,1);
margin: auto;
}
.ratingValue {
+ width: $widthRT;
+ height: 250px;
transition-duration: 0.5s;
}
diff --git a/src/styles/general.scss b/src/styles/general.scss
old mode 100644
new mode 100755
diff --git a/src/styles/index.scss b/src/styles/index.scss
old mode 100644
new mode 100755
diff --git a/src/styles/indexChat.scss b/src/styles/indexChat.scss
old mode 100644
new mode 100755
diff --git a/src/styles/indexExchange.scss b/src/styles/indexExchange.scss
old mode 100644
new mode 100755
index 74afd78..a4b16a1
--- a/src/styles/indexExchange.scss
+++ b/src/styles/indexExchange.scss
@@ -4,12 +4,11 @@
position: relative;
z-index: 0;
- overflow-y: hidden;
+ overflow: hidden;
width: 100%;
- height: auto;
- padding-top: 175px;
+ padding-top: 175px; //175px
margin-left: auto;
margin-right: auto;
@@ -22,14 +21,14 @@
@mixin exchangeChart {
width: 100%;
- height: 600px;
+ height: 600px; //600px
overflow: hidden;
overflow-x: scroll;
.chart {
height: 100%;
- @include centerEx
+ @include centerEx;
.sectionChart {
width: 10px;
height: 100%;
@@ -44,14 +43,14 @@
.sectionCandle {
width: 100%;
height: 400px;
- @include centerEx
+ @include centerEx;
.candle {
width: 100%;
height: auto;
.candleMaxValue {
- @include centerEx
+ @include centerEx;
width: 1px;
}
@@ -65,7 +64,7 @@
}
.candleMinValue {
- @include centerEx
+ @include centerEx;
width: 1px;
}
@@ -75,7 +74,7 @@
width: 100%;
height: 200px;
- @include centerEx
+ @include centerEx;
.volumen {
width: 100%;
@@ -88,41 +87,46 @@
}
.exchangeChartGuest {
- @include exchangeChart
+ @include exchangeChart;
margin-top: 5vh;
}
.exchangeChartUser {
- @include exchangeChart
+ @include exchangeChart;
}
@mixin exchangeInterface {
+
+ z-index: -1;
width: 100%;
- height: auto;
- background: rgba(0,0,0,0.2);
+ height: 70%;
+ position: fixed;
+ top: 15%;
+ right: 0px;
.candleInformation {
- width: 1500px;
- height: 20px;
+ width: 100%;
+ height: auto;
padding-top: 10px;
- padding-bottom: 20px;
+ padding-bottom: 30px;
margin-left: auto;
margin-right: auto;
p {
- width: 250px;
+ width: 16.66%;
text-align: center;
float: left;
+ font-size: 15px;
}
}
}
.exchangeEmptySpace {
- @include exchangeInterface
+ @include exchangeInterface;
}
.exchangeInterface {
- @include exchangeInterface
+ @include exchangeInterface;
}
.exchangeTriggerDativeY {
@@ -143,25 +147,32 @@
transform: margin 700ms;
}
+#exchangeInterfaceTwo {
+ background: rgba(0,0,0,0.1);
+}
+
@mixin gapBetweenSectionsEx {
border-right: 2px dashed;
border-color: rgba(117,82,29,0.7);
}
@mixin exchangeDivInterface {
- width: 32%;
- height: 160px;
- padding-left: 10px;
- padding-right: 10px;
- float:left;
- background: rgba(0,0,0,0.2);
+ width: 31.25%;
+ height: 94%;
+ float: left;
+ padding-left: 1%;
+ padding-right: 1%;
+ padding-top: 10px;
overflow: hidden;
+ p {
+ font-size: 16px;
+ }
@include gapBetweenSectionsEx
}
.exchangeTriggerDiv {
- @include exchangeDivInterface
+ @include exchangeDivInterface;
form {
width: 100%;
@@ -201,7 +212,7 @@
}
.exchangePrognosisDiv {
- @include exchangeDivInterface
+ @include exchangeDivInterface;
input {
width: 100%;
@@ -222,7 +233,7 @@
}
.exchangeNotificationsDiv {
- @include exchangeDivInterface
+ @include exchangeDivInterface;
border-right: 0px;
p {
diff --git a/src/styles/indexForum.scss b/src/styles/indexForum.scss
old mode 100644
new mode 100755
diff --git a/src/styles/menuBar.scss b/src/styles/menuBar.scss
old mode 100644
new mode 100755