Create stories for layout testing (#2722)
* Inject services with useContext * Extract service for video settings * Create mock factories for services * Create test data for chat history * Add story to visualize different layouts * Fix renaming mistake * Add landscape and portrait viewports * Add landscape stories --------- Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
committed by
GitHub
parent
f0f9c2ced1
commit
b38df2fbe3
@@ -1,7 +1,12 @@
|
||||
import { createContext } from 'react';
|
||||
import { ClientConfig } from '../interfaces/client-config.model';
|
||||
|
||||
const ENDPOINT = `/api/config`;
|
||||
|
||||
export interface ClientConfigStaticService {
|
||||
getConfig(): Promise<ClientConfig>;
|
||||
}
|
||||
|
||||
class ClientConfigService {
|
||||
public static async getConfig(): Promise<ClientConfig> {
|
||||
const response = await fetch(ENDPOINT);
|
||||
@@ -10,4 +15,5 @@ class ClientConfigService {
|
||||
}
|
||||
}
|
||||
|
||||
export default ClientConfigService;
|
||||
export const ClientConfigServiceContext =
|
||||
createContext<ClientConfigStaticService>(ClientConfigService);
|
||||
|
||||
Reference in New Issue
Block a user