Skip to content
Snippets Groups Projects
ProfilePage.vue 3.39 KiB
Newer Older
  • Learn to ignore specific revisions
  • Bart Chou's avatar
    Bart Chou committed
    <template>
      <div class="form_wrapper">
        <div class="form_container">
          <div class="title_container">
            <h2>Profile</h2>
            <div class="underline-title"></div>
          </div>
          <div class="row clearfix">
            <div class="">
              <div class="form">
    
    Bart Chou's avatar
    Bart Chou committed
                <div class="profile-label">
                  <div>&nbsp;Username</div>
                  <div>{{profile.username}}&nbsp;</div>
                </div>
    
    Bart Chou's avatar
    Bart Chou committed
                <div class="form-border"></div>
    
    Bart Chou's avatar
    Bart Chou committed
                <div class="profile-label">
                  <div>&nbsp;Email</div>
                  <div>{{profile.email}}&nbsp;</div>
                </div>
    
    Bart Chou's avatar
    Bart Chou committed
                <div class="form-border"></div>
    
    Bart Chou's avatar
    Bart Chou committed
                <div class="profile-label">
                  <div>&nbsp;First Name</div>
                  <div>{{profile.firstName}}&nbsp;</div>
                </div>
    
    Bart Chou's avatar
    Bart Chou committed
                <div class="form-border"></div>
    
    Bart Chou's avatar
    Bart Chou committed
                <div class="profile-label">
                  <div>&nbsp;Last Name</div>
                  <div>{{profile.lastName}}&nbsp;</div>
                </div>
    
    Bart Chou's avatar
    Bart Chou committed
                <div class="form-border"></div>
                <button id="submit-btn" @click.prevent="onClickResetPassword" type="submit" value="Submit">
                  Reset Password
                </button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </template>
    
    <script setup lang="ts">
    
    Bart Chou's avatar
    Bart Chou committed
    import { ref, reactive, onMounted } from "vue";
    
    Bart Chou's avatar
    Bart Chou committed
    import { useRouter } from "vue-router";
    
    Bart Chou's avatar
    Bart Chou committed
    import {getProfile} from "../services/UserService";
    
    Bart Chou's avatar
    Bart Chou committed
    const router = useRouter();
    
    Bart Chou's avatar
    Bart Chou committed
    const profile = reactive({
      username: "",
      email: "",
      firstName: "",
      lastName: "",
    
    Bart Chou's avatar
    Bart Chou committed
    });
    
    Bart Chou's avatar
    Bart Chou committed
    onMounted(async () => {
      await getProfile()
        .then((response) => {
          if (response.status == "OK") {
            const data = response.data
            profile.username = data["username"]
            profile.email = data["email"]
            profile.firstName = data["firstName"]
            profile.lastName = data["lastName"]
          } else {
            alert(response.message)
          }
        })
    })
    
    Bart Chou's avatar
    Bart Chou committed
    const onClickResetPassword = () => {
      router.push("/resetpassword");
    };
    
    </script>
    
    <style scoped>
    body {
      font-family: Verdana, Geneva, sans-serif;
      font-size: 14px;
      background: #f2f2f2;
    }
    
    .form_wrapper {
      justify-content: center;
      align-items: center;
      display: flex;
    }
    
    .form_container {
      background: #fbfbfb;
      border-radius: 8px;
      box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.65);
      height: auto;
      width: 30%;
      padding: 12px 44px;
    }
    
    .title_container {
      font-family: "Raleway Thin", sans-serif;
      letter-spacing: 4px;
      padding-bottom: 23px;
      padding-top: 13px;
      text-align: center;
    }
    
    .form {
      align-items: left;
      display: flex;
      flex-direction: column;
    }
    
    .form-content {
      background: #fbfbfb;
      border: none;
      outline: none;
      padding-top: 14px;
    }
    
    .form-border {
      background: #2ec06f;
      height: 1px;
      width: 100%;
    }
    
    
    Bart Chou's avatar
    Bart Chou committed
    .profile-label {
      padding-top: 13px;
      display: flex;
      flex-direction: row;
      justify-content: space-between;
    }
    
    
    Bart Chou's avatar
    Bart Chou committed
    #submit-btn {
      background: #2ec06f;
      border: none;
      border-radius: 21px;
      box-shadow: 0px 1px 8px #24c64f;
      cursor: pointer;
      color: white;
      font-family: "Raleway SemiBold", sans-serif;
      height: 42.3px;
      margin: 0 auto;
      margin-top: 50px;
      transition: 0.25s;
      width: 153px;
    }
    
    #submit-btn:hover {
      box-shadow: 0px 1px 18px #24c64f;
    }
    
    .underline-title {
      background: -webkit-linear-gradient(right, #a6f77b, #2ec06f);
      height: 2px;
      margin: -1.1rem auto 0 auto;
      width: 200px;
    }
    
    .input_field radio_option {
      margin-top: 10px;
    }
    </style>