mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-18 21:19:44 +00:00
chore: update base font size
This commit is contained in:
parent
f5463af7db
commit
6f9df9dfd7
@ -22,7 +22,7 @@ const ViewSetting = () => {
|
|||||||
<Icon.Settings2 className="w-4 h-auto text-gray-500" />
|
<Icon.Settings2 className="w-4 h-auto text-gray-500" />
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
actionsClassName="top-7 !-right-2"
|
actionsClassName="top-8 !-right-2"
|
||||||
actions={
|
actions={
|
||||||
<div className="w-52 p-2 pt-0 gap-2 flex flex-col justify-start items-start" onClick={(e) => e.stopPropagation()}>
|
<div className="w-52 p-2 pt-0 gap-2 flex flex-col justify-start items-start" onClick={(e) => e.stopPropagation()}>
|
||||||
<div className="w-full flex flex-row justify-between items-center mt-1">
|
<div className="w-full flex flex-row justify-between items-center mt-1">
|
||||||
|
@ -7,7 +7,7 @@ const MemberSection = () => {
|
|||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const [showCreateUserDialog, setShowCreateUserDialog] = useState<boolean>(false);
|
const [showCreateUserDialog, setShowCreateUserDialog] = useState<boolean>(false);
|
||||||
const [currentEditingUser, setCurrentEditingUser] = useState<User | undefined>(undefined);
|
const [currentEditingUser, setCurrentEditingUser] = useState<User | undefined>(undefined);
|
||||||
const userList = Object.values(userStore.userMap);
|
const userList = Object.values(userStore.userMapById);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
userStore.fetchUserList();
|
userStore.fetchUserList();
|
||||||
|
@ -10,9 +10,7 @@ const convertResponseModelUser = (user: User): User => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
interface UserState {
|
interface UserState {
|
||||||
userMap: {
|
userMapById: Record<UserId, User>;
|
||||||
[key: UserId]: User;
|
|
||||||
};
|
|
||||||
currentUserId?: UserId;
|
currentUserId?: UserId;
|
||||||
fetchUserList: () => Promise<User[]>;
|
fetchUserList: () => Promise<User[]>;
|
||||||
fetchCurrentUser: () => Promise<User>;
|
fetchCurrentUser: () => Promise<User>;
|
||||||
@ -24,10 +22,10 @@ interface UserState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const useUserStore = create<UserState>()((set, get) => ({
|
const useUserStore = create<UserState>()((set, get) => ({
|
||||||
userMap: {},
|
userMapById: {},
|
||||||
fetchUserList: async () => {
|
fetchUserList: async () => {
|
||||||
const { data: userList } = await api.getUserList();
|
const { data: userList } = await api.getUserList();
|
||||||
const userMap = get().userMap;
|
const userMap = get().userMapById;
|
||||||
userList.forEach((user) => {
|
userList.forEach((user) => {
|
||||||
userMap[user.id] = convertResponseModelUser(user);
|
userMap[user.id] = convertResponseModelUser(user);
|
||||||
});
|
});
|
||||||
@ -37,13 +35,13 @@ const useUserStore = create<UserState>()((set, get) => ({
|
|||||||
fetchCurrentUser: async () => {
|
fetchCurrentUser: async () => {
|
||||||
const { data } = await api.getMyselfUser();
|
const { data } = await api.getMyselfUser();
|
||||||
const user = convertResponseModelUser(data);
|
const user = convertResponseModelUser(data);
|
||||||
const userMap = get().userMap;
|
const userMap = get().userMapById;
|
||||||
userMap[user.id] = user;
|
userMap[user.id] = user;
|
||||||
set({ userMap, currentUserId: user.id });
|
set({ userMapById: userMap, currentUserId: user.id });
|
||||||
return user;
|
return user;
|
||||||
},
|
},
|
||||||
getOrFetchUserById: async (id: UserId) => {
|
getOrFetchUserById: async (id: UserId) => {
|
||||||
const userMap = get().userMap;
|
const userMap = get().userMapById;
|
||||||
if (userMap[id]) {
|
if (userMap[id]) {
|
||||||
return userMap[id] as User;
|
return userMap[id] as User;
|
||||||
}
|
}
|
||||||
@ -57,7 +55,7 @@ const useUserStore = create<UserState>()((set, get) => ({
|
|||||||
createUser: async (userCreate: UserCreate) => {
|
createUser: async (userCreate: UserCreate) => {
|
||||||
const { data } = await api.createUser(userCreate);
|
const { data } = await api.createUser(userCreate);
|
||||||
const user = convertResponseModelUser(data);
|
const user = convertResponseModelUser(data);
|
||||||
const userMap = get().userMap;
|
const userMap = get().userMapById;
|
||||||
userMap[user.id] = user;
|
userMap[user.id] = user;
|
||||||
set(userMap);
|
set(userMap);
|
||||||
return user;
|
return user;
|
||||||
@ -65,16 +63,16 @@ const useUserStore = create<UserState>()((set, get) => ({
|
|||||||
patchUser: async (userPatch: UserPatch) => {
|
patchUser: async (userPatch: UserPatch) => {
|
||||||
const { data } = await api.patchUser(userPatch);
|
const { data } = await api.patchUser(userPatch);
|
||||||
const user = convertResponseModelUser(data);
|
const user = convertResponseModelUser(data);
|
||||||
const userMap = get().userMap;
|
const userMap = get().userMapById;
|
||||||
userMap[user.id] = user;
|
userMap[user.id] = user;
|
||||||
set(userMap);
|
set(userMap);
|
||||||
},
|
},
|
||||||
getUserById: (id: UserId) => {
|
getUserById: (id: UserId) => {
|
||||||
const userMap = get().userMap;
|
const userMap = get().userMapById;
|
||||||
return userMap[id] as User;
|
return userMap[id] as User;
|
||||||
},
|
},
|
||||||
getCurrentUser: () => {
|
getCurrentUser: () => {
|
||||||
const userMap = get().userMap;
|
const userMap = get().userMapById;
|
||||||
const currentUserId = get().currentUserId;
|
const currentUserId = get().currentUserId;
|
||||||
return userMap[currentUserId as UserId];
|
return userMap[currentUserId as UserId];
|
||||||
},
|
},
|
||||||
|
@ -5,7 +5,7 @@ module.exports = {
|
|||||||
fontSize: {
|
fontSize: {
|
||||||
xs: ".75rem",
|
xs: ".75rem",
|
||||||
sm: ".875rem",
|
sm: ".875rem",
|
||||||
base: "0.95rem",
|
base: "1rem",
|
||||||
lg: "1.125rem",
|
lg: "1.125rem",
|
||||||
xl: "1.25rem",
|
xl: "1.25rem",
|
||||||
"2xl": "1.5rem",
|
"2xl": "1.5rem",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user