Changeset e007fcd for components


Ignore:
Timestamp:
07/16/22 21:31:18 (2 years ago)
Author:
anastasovv <simon@…>
Branches:
main
Children:
e903234
Parents:
55701f0
Message:

Now you need to activate your account via email & also added mail sending after server crash

Location:
components
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • components/Header.jsx

    r55701f0 re007fcd  
    116116              ...playerState.player,
    117117              displayName: res.data?.displayName,
    118               sesssion_id: res.data?.session_id,
     118              username: res.data?.username,
     119              session_id: res.data?.session_id,
    119120              credits: res.data?.credits,
    120121            }));
  • components/LoginScreen.jsx

    r55701f0 re007fcd  
    139139                <div>
    140140                    <span>Username:</span>
    141                     <input ref={ref} type="text" onChange={(e) => {onChangeUsername(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.loginScreenInfo.username} placeholder="your username..."/>
     141                    <input ref={ref} type="text" onChange={(e) => {onChangeUsername(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.loginScreenInfo.username} placeholder="johndoe"/>
    142142                    <span>Password:</span>
    143                     <input type="password" onChange={(e) => {onChangePassword(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.loginScreenInfo.password} placeholder="your password..."/>
     143                    <input type="password" onChange={(e) => {onChangePassword(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.loginScreenInfo.password} placeholder="****************"/>
    144144                    <div style={{width: '100%', display: 'flex', flexDirection: 'row', justifyContent: 'space-between'}}>
    145145                        <button className="primaryButton" onClick={() => closeForm()}>Close Form</button>
  • components/RegisterScreen.jsx

    r55701f0 re007fcd  
    2828        }
    2929    }, 10);
     30
     31    function onChangeEmail(e) {
     32        dispatch(setStyle({
     33            ...styleState.style,
     34            registerScreenInfo: {
     35                ...styleState.style.registerScreenInfo,
     36                email: e.target.value,
     37            }
     38        }))
     39    }
    3040
    3141    function onChangeUsername(e) {
     
    8696        axios.post('/api/postgre', {
    8797            action: 'register',
     98            email: styleState.style.registerScreenInfo.email,
    8899            username: styleState.style.registerScreenInfo.username,
    89100            displayName: styleState.style.registerScreenInfo.displayName,
     
    109120                        notification: {
    110121                            show: true,
    111                             text: 'Successfully registered! Please Log In now.',
     122                            text: 'Successfully registered! Please check your email and activate your account.',
    112123                            status: 'success',
    113124                        },
     
    130141                {styleState.style.inlineAlertText.length > 0 && <span className="inlineAlert">{styleState.style.inlineAlertText}</span>}
    131142                <div>
     143                    <span>Email:</span>
     144                    <input ref={ref} type="text" onChange={(e) => {onChangeEmail(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.registerScreenInfo.email} placeholder="john.doe@gmail.com"/>
    132145                    <span>Username:</span>
    133                     <input ref={ref} type="text" onChange={(e) => {onChangeUsername(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.registerScreenInfo.username} placeholder="your username..."/>
     146                    <input type="text" onChange={(e) => {onChangeUsername(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.registerScreenInfo.username} placeholder="johndoe"/>
    134147                    <span>Display Name:</span>
    135                     <input type="text" onChange={(e) => {onChangeDisplayName(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.registerScreenInfo.displayName} placeholder="your display name..."/>
     148                    <input type="text" onChange={(e) => {onChangeDisplayName(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.registerScreenInfo.displayName} placeholder="John Doe"/>
    136149                    <span>Password:</span>
    137                     <input type="password" onChange={(e) => {onChangePassword(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.registerScreenInfo.password} placeholder="your password..."/>
     150                    <input type="password" onChange={(e) => {onChangePassword(e)}} onKeyUp={(e) => keyUp(e)} value={styleState.style.registerScreenInfo.password} placeholder="***************"/>
    138151                    <div style={{width: '100%', display: 'flex', flexDirection: 'row', justifyContent: 'space-between'}}>
    139152                        <button className="primaryButton" onClick={() => closeForm()}>Close Form</button>
  • components/blackjack/BlackjackHeader.jsx

    r55701f0 re007fcd  
    6060                    axios.get(`/api/blackjack?action=update_state&session_id=${localStorage.CAESSINO_SESSION_ID}`).then(newRes => {
    6161                        if (newRes.data?.success) {
     62                            console.log(newRes.data);
     63
    6264                            dispatch(setBlackjackGame(newRes.data?.blackjackGame))
    6365
  • components/poker/PokerHeader.jsx

    r55701f0 re007fcd  
    3434        axios.get(`/api/poker?action=get_player_info_on_enter&session_id=${localStorage.CAESSINO_SESSION_ID}`).then(res => {
    3535            if (res.data?.success) {
     36                dispatch(setPlayer({
     37                    ...playerState.player,
     38                    displayName: res.data?.displayName,
     39                    username: res.data?.username,
     40                    session_id: res.data?.session_id,
     41                    credits: res.data?.credits,
     42                }))
     43
    3644                if (interval !== null) clearInterval(interval);
    3745
  • components/poker/sections/PickATable.jsx

    r55701f0 re007fcd  
    3232
    3333    function createATable() {
    34         axios.get(`/api/poker?action=create_a_table&session_id=${localStorage.CAESSINO_SESSION_ID}&displayName=${playerState.player.displayName}&tableName=${styleState.poker.inputControls.tableName}`);
     34        axios.get(`/api/poker?action=create_a_table&session_id=${localStorage.CAESSINO_SESSION_ID}&displayName=${playerState.player.displayName}&tableName=${styleState.poker.inputControls.tableName}&username=${playerState.player.username}`);
    3535    }
    3636
    3737    function joinATable(e) {
    38         axios.get(`/api/poker?action=join_a_table&session_id=${localStorage.CAESSINO_SESSION_ID}&tableId=${e.target?.dataset?.table}&displayName=${playerState.player.displayName}`);
     38        axios.get(`/api/poker?action=join_a_table&session_id=${localStorage.CAESSINO_SESSION_ID}&tableId=${e.target?.dataset?.table}&displayName=${playerState.player.displayName}&username=${playerState.player.username}`);
    3939    }
    4040
  • components/roulette/RouletteHeader.jsx

    r55701f0 re007fcd  
    77import { AiOutlineArrowLeft } from 'react-icons/ai'
    88
    9 import { useEffect } from 'react'
     9import { useEffect, useState } from 'react'
    1010import { useDispatch, useSelector } from 'react-redux'
    1111
     
    8686                        }
    8787
    88                         if (newRes.data?.extraAction && newRes.data?.extraAction !== "spin_wheel") {
     88                        if (newRes.data?.extraAction !== "spin_wheel" && newRes.data?.extraAction2 !== "keep_alert") {
    8989                            dispatch(setStyle({
    9090                                ...styleState.style,
Note: See TracChangeset for help on using the changeset viewer.