Changeset cae16b5 for reactapp/src/Pages


Ignore:
Timestamp:
09/30/22 15:23:25 (22 months ago)
Author:
unknown <mlviktor23@…>
Branches:
main
Children:
8d83180
Parents:
62b653f
Message:

implemented registration in react

Location:
reactapp/src/Pages
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • reactapp/src/Pages/Login.js

    r62b653f rcae16b5  
    44import axios from "../api/axios";
    55import Cookies from "js-cookie";
     6import { LoginButton, LoginInput } from "../Components/Styled/Login.style";
    67const LOGIN_URL = "/login";
    78
     
    4849    <Navigate to="/user_dashboard" />
    4950  ) : (
    50     <div style={{ marginTop: "140px" }}>
    51       <p ref={errRef} className={errMsg ? "errmsg" : "offscreen"}>
    52         {errMsg}
    53       </p>
    54       <h1>Најава</h1>
    55       <form onSubmit={handleSubmit}>
    56         <label htmlFor="username">E-mail:</label>
    57         <input
     51    <div
     52      style={{
     53        marginTop: "140px",
     54        display: "flex",
     55        alignItems: "center",
     56        flexFlow: "column",
     57        width: "fit-content",
     58        margin: "auto",
     59        border: "2px solid lightgrey",
     60        padding: "25px",
     61        boxShadow: "2px 2px 6px #aaaaaa",
     62        marginBottom: "80px",
     63      }}
     64    >
     65      <h2>Најава</h2>
     66      <form
     67        onSubmit={handleSubmit}
     68        style={{
     69          display: "flex",
     70          flexDirection: "column",
     71          alignItems: "center",
     72          width: "400px",
     73        }}
     74      >
     75        <LoginInput
    5876          type="text"
    5977          id="username"
     
    6381          value={username}
    6482          required
     83          placeholder="Email"
    6584        />
    66         <label htmlFor="password">Лозинка:</label>
    67         <input
     85        <LoginInput
    6886          type="password"
    6987          id="password"
    7088          onChange={(e) => setPassword(e.target.value)}
    7189          value={password}
     90          placeholder="Лозинка"
    7291          required
    7392        />
    74         <button>Најави се</button>
     93        <LoginButton>Најави се</LoginButton>
     94        <p
     95          ref={errRef}
     96          className={errMsg ? "errmsg" : "offscreen"}
     97          style={{ color: "red", marginTop: "20px" }}
     98        >
     99          {errMsg}
     100        </p>
    75101      </form>
     102      <p style={{ marginTop: "20px" }}>
     103        Немаш сметка? <a href="/registration">Регистрирај се</a>{" "}
     104      </p>
    76105    </div>
    77106  );
  • reactapp/src/Pages/UserDashboard.js

    r62b653f rcae16b5  
    2424      <h3>Кориснички податоци:</h3>
    2525      <UserDetailsCard>
    26         <UserDetailsCardContent>
    27           <b>Име:</b> {user.fullName}{" "}
    28           <i style={{ fontSize: 14, color: "#0066cc" }}>
    29             (<u>промени</u>)
    30           </i>
    31         </UserDetailsCardContent>
     26        {user.fullName && (
     27          <UserDetailsCardContent>
     28            <b>Име:</b> {user.fullName}{" "}
     29          </UserDetailsCardContent>
     30        )}
    3231        <UserDetailsCardContent>
    3332          <b>Корисничко име:</b> {user.username}{" "}
    34           <i style={{ fontSize: 14, color: "#0066cc" }}>
    35             (<u>промени</u>)
    36           </i>
    3733        </UserDetailsCardContent>
    3834        <UserDetailsCardContent>
Note: See TracChangeset for help on using the changeset viewer.