big update && resolve problems and bugs
1
run.sh
|
|
@ -1,2 +1,3 @@
|
||||||
sudo sysctl fs.inotify.max_user_watches=524288
|
sudo sysctl fs.inotify.max_user_watches=524288
|
||||||
|
gatsby clean
|
||||||
gatsby develop
|
gatsby develop
|
||||||
|
|
@ -51,6 +51,16 @@ const IndexExchange = ({
|
||||||
setMousePosition({ x: event.pageX, y: event.pageY })
|
setMousePosition({ x: event.pageX, y: event.pageY })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect( () => responsiveIntrface())
|
||||||
|
|
||||||
|
const responsiveIntrface = () => {
|
||||||
|
if ( user.id != -1) {
|
||||||
|
let chartHeight = 600
|
||||||
|
let chartPaddingTop = 175
|
||||||
|
let exchangeInterfaceHeight = window.innerHeight - (chartHeight + chartPaddingTop)
|
||||||
|
document.getElementById('exchangeInterfaceTwo').style = 'height: ' + exchangeInterfaceHeight + 'px;'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='indexExchange'>
|
<div className='indexExchange'>
|
||||||
|
|
@ -129,15 +139,16 @@ const IndexExchange = ({
|
||||||
</div>
|
</div>
|
||||||
<div className={user.id > -1 ? 'exchangeInterface' : 'exchangeEmptySpace'}>
|
<div className={user.id > -1 ? 'exchangeInterface' : 'exchangeEmptySpace'}>
|
||||||
<div className='candleInformation'>
|
<div className='candleInformation'>
|
||||||
<p>Open: { candleInfo.Open } PLN,</p>
|
<p>Open: {candleInfo.Open} PLN</p>
|
||||||
<p>Close: { candleInfo.Close } PLN,</p>
|
<p>Close: {candleInfo.Close} PLN</p>
|
||||||
<p>Max: { candleInfo.Max } PLN,</p>
|
<p>Max: {candleInfo.Max} PLN</p>
|
||||||
<p>Min: { candleInfo.Min } PLN,</p>
|
<p>Min: {candleInfo.Min} PLN</p>
|
||||||
<p>Volume: { candleInfo.Vol },</p>
|
<p>Volume: {candleInfo.Vol}</p>
|
||||||
<p>Date: {candleInfo.Date}</p>
|
<p>Date: {candleInfo.Date}</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{user.id > -1 ? (
|
{user.id > -1 ? (
|
||||||
<div>
|
<div id='exchangeInterfaceTwo'>
|
||||||
<ExchangeTriggerAdd triggerValue={triggerValue} />
|
<ExchangeTriggerAdd triggerValue={triggerValue} />
|
||||||
<ExchangePrognosis />
|
<ExchangePrognosis />
|
||||||
<ExchangeNotifications />
|
<ExchangeNotifications />
|
||||||
|
|
@ -147,7 +158,6 @@ const IndexExchange = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,15 @@ const ForumCommentUpdate = ({
|
||||||
|
|
||||||
const updateCommentTextArea = React.createRef()
|
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()
|
event.preventDefault()
|
||||||
if ( updateCommentTextArea.current.value !== '' ) {
|
if ( updateCommentTextArea.current.value !== '' ) {
|
||||||
let commentData = {
|
let commentData = {
|
||||||
|
|
@ -25,7 +33,9 @@ const ForumCommentUpdate = ({
|
||||||
text: updateCommentTextArea.current.value
|
text: updateCommentTextArea.current.value
|
||||||
}
|
}
|
||||||
updateCommentTextArea.current.value = ''
|
updateCommentTextArea.current.value = ''
|
||||||
updateComment(commentData)
|
await updateComment(commentData)
|
||||||
|
await sleep(100)
|
||||||
|
await refreshSubjectComments(subjectLoad)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,15 @@ const ForumComments = ({
|
||||||
|
|
||||||
const addCommentTextArea = React.createRef()
|
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()
|
event.preventDefault()
|
||||||
if ( addCommentTextArea.current.value !== '' ) {
|
if ( addCommentTextArea.current.value !== '' ) {
|
||||||
let newComment = {
|
let newComment = {
|
||||||
|
|
@ -33,25 +41,21 @@ const ForumComments = ({
|
||||||
token: user.token
|
token: user.token
|
||||||
}
|
}
|
||||||
addCommentTextArea.current.value = ''
|
addCommentTextArea.current.value = ''
|
||||||
addComment(newComment)
|
await addComment( newComment )
|
||||||
|
await sleep(100)
|
||||||
|
await refreshSubjectComments(subjectLoad)
|
||||||
setFormDiv( !formDiv )
|
setFormDiv( !formDiv )
|
||||||
let actualSubject = {
|
|
||||||
id: subjects.actualSubjectID
|
|
||||||
}
|
|
||||||
refreshSubjectComments(actualSubject)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteOldComment = (commentID) => {
|
const deleteOldComment = async(commentID) => {
|
||||||
let delComment = {
|
let delComment = {
|
||||||
id: commentID,
|
id: commentID,
|
||||||
token: user.token
|
token: user.token
|
||||||
}
|
}
|
||||||
deleteComment(delComment)
|
await deleteComment(delComment)
|
||||||
let actualSubject = {
|
await sleep(100)
|
||||||
id: subjects.actualSubjectID
|
await refreshSubjectComments(subjectLoad)
|
||||||
}
|
|
||||||
refreshSubjectComments(actualSubject)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const [commentText, setCommentText] = useState(0)
|
const [commentText, setCommentText] = useState(0)
|
||||||
|
|
|
||||||
|
|
@ -57,21 +57,22 @@ const ForumRatings = ({
|
||||||
let divYPositionOnPage = ratingDiv.getBoundingClientRect().top + 72
|
let divYPositionOnPage = ratingDiv.getBoundingClientRect().top + 72
|
||||||
let yPosition = event.screenY - divYPositionOnPage
|
let yPosition = event.screenY - divYPositionOnPage
|
||||||
|
|
||||||
if ( yPosition > 200 ) {
|
if ( yPosition > 270 ) {
|
||||||
setValue(5)
|
setValue(5)
|
||||||
}
|
}
|
||||||
else if ( yPosition > 150 && yPosition < 200 ) {
|
else if ( yPosition > 215 && yPosition < 270 ) {
|
||||||
setValue(4)
|
setValue(4)
|
||||||
}
|
}
|
||||||
else if ( yPosition > 100 && yPosition < 150 ) {
|
else if ( yPosition > 168 && yPosition < 215 ) {
|
||||||
setValue(3)
|
setValue(3)
|
||||||
}
|
}
|
||||||
else if ( yPosition > 50 && yPosition < 150 ) {
|
else if ( yPosition > 120 && yPosition < 168 ) {
|
||||||
setValue(2)
|
setValue(2)
|
||||||
}
|
}
|
||||||
else if ( yPosition > 0 && yPosition < 50 ) {
|
else if ( yPosition > 60 && yPosition < 120 ) {
|
||||||
setValue(1)
|
setValue(1)
|
||||||
}
|
}
|
||||||
|
console.log(yPosition)
|
||||||
}
|
}
|
||||||
|
|
||||||
const [updateRating, setUpdate] = useState(false)
|
const [updateRating, setUpdate] = useState(false)
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ const ForumSubjects = ({
|
||||||
const addSubjectTitle = React.createRef()
|
const addSubjectTitle = React.createRef()
|
||||||
const addSubjectComment = React.createRef()
|
const addSubjectComment = React.createRef()
|
||||||
|
|
||||||
|
|
||||||
const addNewSubject = (event) => {
|
const addNewSubject = (event) => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
if ( addSubjectTitle.current.value !== '' && addSubjectComment.current.value !== '' ) {
|
if ( addSubjectTitle.current.value !== '' && addSubjectComment.current.value !== '' ) {
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 163 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
|
@ -4,6 +4,11 @@ const getRatingsComment = item => ({
|
||||||
type: types.GET_COMMENTS_RATINGS, item
|
type: types.GET_COMMENTS_RATINGS, item
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const addComment = item => ({
|
||||||
|
type: types.ADD_COMMENT, item
|
||||||
|
})
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getRatingsComment
|
getRatingsComment,
|
||||||
|
addComment
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
const GET_COMMENTS_RATINGS = 'GET_COMMENTS_RATINGS'
|
const GET_COMMENTS_RATINGS = 'GET_COMMENTS_RATINGS'
|
||||||
|
const ADD_COMMENT = 'ADD_COMMENT'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
GET_COMMENTS_RATINGS
|
GET_COMMENTS_RATINGS,
|
||||||
|
ADD_COMMENT
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ const persistedState = loadState();
|
||||||
|
|
||||||
export const store = createStore(rootReducer, persistedState, composeWithDevTools(applyMiddleware(thunk)))
|
export const store = createStore(rootReducer, persistedState, composeWithDevTools(applyMiddleware(thunk)))
|
||||||
|
|
||||||
console.log(store.getState())
|
// console.log(store.getState())
|
||||||
|
|
||||||
store.subscribe(() => {
|
store.subscribe(() => {
|
||||||
saveState({
|
saveState({
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,13 @@ const deactivate = item => ({
|
||||||
type: types.DEACTIVATE, item
|
type: types.DEACTIVATE, item
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const addComment = item => ({
|
||||||
|
type: types.ADD_COMMENT, item
|
||||||
|
})
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getSubjectComments,
|
getSubjectComments,
|
||||||
activate,
|
activate,
|
||||||
deactivate
|
deactivate,
|
||||||
|
addComment
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,11 @@ const subjectReducer = (state = INITIAL_STATE, action) => {
|
||||||
actualSubjectAuthorID: -1,
|
actualSubjectAuthorID: -1,
|
||||||
isActive: false
|
isActive: false
|
||||||
}
|
}
|
||||||
|
case types.ADD_COMMENT:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
commentsList: [...state.commentsList, action.item]
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
const GET_SUBJECT_COMMENTS = 'GET_SUBJECT_COMMENTS'
|
const GET_SUBJECT_COMMENTS = 'GET_SUBJECT_COMMENTS'
|
||||||
const ACTIVATE = 'ACTIVATE'
|
const ACTIVATE = 'ACTIVATE'
|
||||||
const DEACTIVATE = 'DEACTIVATE'
|
const DEACTIVATE = 'DEACTIVATE'
|
||||||
|
const ADD_COMMENT = 'ADD_COMMENT'
|
||||||
|
|
||||||
export default{
|
export default{
|
||||||
GET_SUBJECT_COMMENTS,
|
GET_SUBJECT_COMMENTS,
|
||||||
ACTIVATE,
|
ACTIVATE,
|
||||||
DEACTIVATE
|
DEACTIVATE,
|
||||||
|
ADD_COMMENT
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,14 @@ $widthRT: 40px;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
height: 250px;
|
height: 250px;
|
||||||
|
|
||||||
background-color: rgba(117,82,29,1);
|
border: solid 1px;
|
||||||
|
border-color: rgba(117,82,29,1);
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ratingValue {
|
.ratingValue {
|
||||||
|
width: $widthRT;
|
||||||
|
height: 250px;
|
||||||
transition-duration: 0.5s;
|
transition-duration: 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,11 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
|
||||||
overflow-y: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
|
||||||
|
|
||||||
padding-top: 175px;
|
padding-top: 175px; //175px
|
||||||
|
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
|
|
@ -22,14 +21,14 @@
|
||||||
@mixin exchangeChart {
|
@mixin exchangeChart {
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 600px;
|
height: 600px; //600px
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
overflow-x: scroll;
|
overflow-x: scroll;
|
||||||
|
|
||||||
.chart {
|
.chart {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
@include centerEx
|
@include centerEx;
|
||||||
.sectionChart {
|
.sectionChart {
|
||||||
width: 10px;
|
width: 10px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
@ -44,14 +43,14 @@
|
||||||
.sectionCandle {
|
.sectionCandle {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 400px;
|
height: 400px;
|
||||||
@include centerEx
|
@include centerEx;
|
||||||
|
|
||||||
.candle {
|
.candle {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
.candleMaxValue {
|
.candleMaxValue {
|
||||||
@include centerEx
|
@include centerEx;
|
||||||
|
|
||||||
width: 1px;
|
width: 1px;
|
||||||
}
|
}
|
||||||
|
|
@ -65,7 +64,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.candleMinValue {
|
.candleMinValue {
|
||||||
@include centerEx
|
@include centerEx;
|
||||||
|
|
||||||
width: 1px;
|
width: 1px;
|
||||||
}
|
}
|
||||||
|
|
@ -75,7 +74,7 @@
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
@include centerEx
|
@include centerEx;
|
||||||
|
|
||||||
.volumen {
|
.volumen {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -88,41 +87,46 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.exchangeChartGuest {
|
.exchangeChartGuest {
|
||||||
@include exchangeChart
|
@include exchangeChart;
|
||||||
|
|
||||||
margin-top: 5vh;
|
margin-top: 5vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exchangeChartUser {
|
.exchangeChartUser {
|
||||||
@include exchangeChart
|
@include exchangeChart;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin exchangeInterface {
|
@mixin exchangeInterface {
|
||||||
|
|
||||||
|
z-index: -1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: 70%;
|
||||||
background: rgba(0,0,0,0.2);
|
position: fixed;
|
||||||
|
top: 15%;
|
||||||
|
right: 0px;
|
||||||
|
|
||||||
.candleInformation {
|
.candleInformation {
|
||||||
width: 1500px;
|
width: 100%;
|
||||||
height: 20px;
|
height: auto;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 30px;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
width: 250px;
|
width: 16.66%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
float: left;
|
float: left;
|
||||||
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.exchangeEmptySpace {
|
.exchangeEmptySpace {
|
||||||
@include exchangeInterface
|
@include exchangeInterface;
|
||||||
}
|
}
|
||||||
.exchangeInterface {
|
.exchangeInterface {
|
||||||
@include exchangeInterface
|
@include exchangeInterface;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exchangeTriggerDativeY {
|
.exchangeTriggerDativeY {
|
||||||
|
|
@ -143,25 +147,32 @@
|
||||||
transform: margin 700ms;
|
transform: margin 700ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#exchangeInterfaceTwo {
|
||||||
|
background: rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
@mixin gapBetweenSectionsEx {
|
@mixin gapBetweenSectionsEx {
|
||||||
border-right: 2px dashed;
|
border-right: 2px dashed;
|
||||||
border-color: rgba(117,82,29,0.7);
|
border-color: rgba(117,82,29,0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin exchangeDivInterface {
|
@mixin exchangeDivInterface {
|
||||||
width: 32%;
|
width: 31.25%;
|
||||||
height: 160px;
|
height: 94%;
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 10px;
|
|
||||||
float: left;
|
float: left;
|
||||||
background: rgba(0,0,0,0.2);
|
padding-left: 1%;
|
||||||
|
padding-right: 1%;
|
||||||
|
padding-top: 10px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
p {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
@include gapBetweenSectionsEx
|
@include gapBetweenSectionsEx
|
||||||
}
|
}
|
||||||
|
|
||||||
.exchangeTriggerDiv {
|
.exchangeTriggerDiv {
|
||||||
@include exchangeDivInterface
|
@include exchangeDivInterface;
|
||||||
|
|
||||||
form {
|
form {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -201,7 +212,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.exchangePrognosisDiv {
|
.exchangePrognosisDiv {
|
||||||
@include exchangeDivInterface
|
@include exchangeDivInterface;
|
||||||
|
|
||||||
input {
|
input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -222,7 +233,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.exchangeNotificationsDiv {
|
.exchangeNotificationsDiv {
|
||||||
@include exchangeDivInterface
|
@include exchangeDivInterface;
|
||||||
border-right: 0px;
|
border-right: 0px;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
|
|
|
||||||