Skip to content
Snippets Groups Projects
  • Sean Hatfield's avatar
    fcb591d3
    Add user PFP support and context to logo (#408) · fcb591d3
    Sean Hatfield authored
    
    * fix sizing of onboarding modals & lint
    
    * fix extra scrolling on mobile onboarding flow
    
    * added message to use desktop for onboarding
    
    * linting
    
    * add arrow to scroll to bottom (debounced) and fix chat scrolling to always scroll to very bottom on message history change
    
    * fix for empty chat
    
    * change mobile alert copy
    
    * WIP adding PFP upload support
    
    * WIP pfp for users
    
    * edit account menu complete with change username/password and upload profile picture
    
    * add pfp context to update all instances of usePfp hook on update
    
    * linting
    
    * add context for logo change to immediately update logo
    
    * fix div with bullet points to use list-disc instead
    
    * fix: small changes
    
    * update multer file storage locations
    
    * fix: use STORAGE_DIR for filepathing
    
    ---------
    
    Co-authored-by: default avatartimothycarambat <rambat1010@gmail.com>
    Add user PFP support and context to logo (#408)
    Sean Hatfield authored
    
    * fix sizing of onboarding modals & lint
    
    * fix extra scrolling on mobile onboarding flow
    
    * added message to use desktop for onboarding
    
    * linting
    
    * add arrow to scroll to bottom (debounced) and fix chat scrolling to always scroll to very bottom on message history change
    
    * fix for empty chat
    
    * change mobile alert copy
    
    * WIP adding PFP upload support
    
    * WIP pfp for users
    
    * edit account menu complete with change username/password and upload profile picture
    
    * add pfp context to update all instances of usePfp hook on update
    
    * linting
    
    * add context for logo change to immediately update logo
    
    * fix div with bullet points to use list-disc instead
    
    * fix: small changes
    
    * update multer file storage locations
    
    * fix: use STORAGE_DIR for filepathing
    
    ---------
    
    Co-authored-by: default avatartimothycarambat <rambat1010@gmail.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
LogoContext.jsx 740 B
import { createContext, useEffect, useState } from "react";
import AnythingLLM from "./media/logo/anything-llm.png";
import System from "./models/system";

export const LogoContext = createContext();

export function LogoProvider({ children }) {
  const [logo, setLogo] = useState("");

  useEffect(() => {
    async function fetchInstanceLogo() {
      try {
        const logoURL = await System.fetchLogo();
        logoURL ? setLogo(logoURL) : setLogo(AnythingLLM);
      } catch (err) {
        setLogo(AnythingLLM);
        console.error("Failed to fetch logo:", err);
      }
    }
    fetchInstanceLogo();
  }, []);

  return (
    <LogoContext.Provider value={{ logo, setLogo }}>
      {children}
    </LogoContext.Provider>
  );
}