diff --git a/src/assets/js/components/popup/settings.jsx b/src/assets/js/components/popup/settings.jsx
index 82d9640..eda325b 100644
--- a/src/assets/js/components/popup/settings.jsx
+++ b/src/assets/js/components/popup/settings.jsx
@@ -1,21 +1,41 @@
import React from 'react';
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
import { useDispatch } from 'react-redux';
import classNames from 'classnames';
import { signOut } from '@/features/popup/popupSlice';
+import { getCompany, getUser } from '@/main'
+import { PopupSpinner } from '@/components/popup/popup-spinner';
export const Settings = () => {
const dispatch = useDispatch();
- const [isLoading, setIsLoading] = useState(false);
+ const [isButtonLoading, setIsButtonLoading] = useState(false);
+ const [companyName, setCompanyName] = useState('');
+ const [isViewLoading, setIsViewLoading] = useState(false);
+
+ const getCompanyData = async () => {
+ setIsViewLoading(true);
+ const user = await getUser();
+ const company = await getCompany(user);
+ setCompanyName(company);
+ setIsViewLoading(false);
+ };
+
+ useEffect(() => {
+ getCompanyData();
+ }, [companyName]);
const handleSignOut = async (event) => {
event.preventDefault();
- setIsLoading(true);
+ setIsButtonLoading(true);
dispatch(signOut());
- setIsLoading(false);
+ setIsButtonLoading(false);
};
+ if (isViewLoading) {
+ return
+ You are signed in as a member of {companyName}. +
+ ) + }