nicolium: move stuff around and rename
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@@ -47,11 +47,11 @@ const fetchFrontendConfig =
|
||||
dispatch(importFrontendConfig(data[key], host));
|
||||
return data[key];
|
||||
} else {
|
||||
return dispatch(fetchPlFeJson(host));
|
||||
return dispatch(fetchFrontendConfigJson(host));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return dispatch(fetchPlFeJson(host));
|
||||
return dispatch(fetchFrontendConfigJson(host));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -69,7 +69,7 @@ const loadFrontendConfig = () => async (dispatch: AppDispatch, getState: () => R
|
||||
}
|
||||
};
|
||||
|
||||
const fetchPlFeJson = (host: string | null) => (dispatch: AppDispatch) =>
|
||||
const fetchFrontendConfigJson = (host: string | null) => (dispatch: AppDispatch) =>
|
||||
staticFetch('/instance/pl-fe.json')
|
||||
.then(({ json: data }) => {
|
||||
if (!isObject(data)) throw 'pl-fe.json fetch failed';
|
||||
|
||||
@@ -28,6 +28,6 @@ const env = compileTime(() => {
|
||||
|
||||
const { NODE_ENV, BACKEND_URL, FE_SUBDIRECTORY, WITH_LANDING_PAGE, BANNER_HTML } = env;
|
||||
|
||||
export type PlFeEnv = typeof env;
|
||||
export type FrontendEnv = typeof env;
|
||||
|
||||
export { NODE_ENV, BACKEND_URL, FE_SUBDIRECTORY, WITH_LANDING_PAGE, BANNER_HTML };
|
||||
|
||||
@@ -546,7 +546,7 @@ const ParsedMfm: React.FC<IParsedMfm> = React.memo(({ text, emojis, mentions, sp
|
||||
.flat(Infinity);
|
||||
|
||||
return (
|
||||
<bdi className='plfe-mfm block overflow-hidden'>
|
||||
<bdi className='⁂-mfm block overflow-hidden'>
|
||||
<span>{genEl(rootAst, 1)}</span>
|
||||
</bdi>
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ import { useSettings } from '@/stores/settings';
|
||||
const Helmet = React.lazy(() => import('@/components/helmet'));
|
||||
|
||||
/** Injects metadata into site head with Helmet. */
|
||||
const PlFeHead = () => {
|
||||
const NicoliumHead = () => {
|
||||
const locale = useLocale();
|
||||
const direction = useLocaleDirection(locale);
|
||||
const {
|
||||
@@ -95,4 +95,4 @@ const PlFeHead = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export { PlFeHead as default };
|
||||
export { NicoliumHead as default };
|
||||
@@ -24,12 +24,12 @@ const loadInitial = () => async (dispatch: AppDispatch) => {
|
||||
await dispatch(loadFrontendConfig());
|
||||
};
|
||||
|
||||
interface IPlFeLoad {
|
||||
interface INicoliumLoad {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
/** Initial data loader. */
|
||||
const PlFeLoad: React.FC<IPlFeLoad> = ({ children }) => {
|
||||
const NicoliumLoad: React.FC<INicoliumLoad> = ({ children }) => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const me = useAppSelector((state) => state.me);
|
||||
@@ -77,4 +77,4 @@ const PlFeLoad: React.FC<IPlFeLoad> = ({ children }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export { PlFeLoad as default };
|
||||
export { NicoliumLoad as default };
|
||||
@@ -4,7 +4,7 @@ import LoadingScreen from '@/components/loading-screen';
|
||||
import { RouterWithContext } from '@/features/ui/router';
|
||||
|
||||
/** Highest level node with the Redux store. */
|
||||
const PlFeMount = () => {
|
||||
const NicoliumMount = () => {
|
||||
return (
|
||||
<Suspense fallback={<LoadingScreen />}>
|
||||
<RouterWithContext />
|
||||
@@ -12,4 +12,4 @@ const PlFeMount = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export { PlFeMount as default };
|
||||
export { NicoliumMount as default };
|
||||
@@ -10,25 +10,25 @@ import { queryClient } from '@/queries/client';
|
||||
import { preload } from '../actions/preload';
|
||||
import { store } from '../store';
|
||||
|
||||
import PlFeHead from './pl-fe-head';
|
||||
import PlFeLoad from './pl-fe-load';
|
||||
import PlFeMount from './pl-fe-mount';
|
||||
import NicoliumHead from './nicolium-head';
|
||||
import NicoliumLoad from './nicolium-load';
|
||||
import NicoliumMount from './nicolium-mount';
|
||||
|
||||
// Preload happens synchronously
|
||||
store.dispatch(preload() as any);
|
||||
|
||||
/** The root React node of the application. */
|
||||
const PlFe: React.FC = () => (
|
||||
const Nicolium: React.FC = () => (
|
||||
<>
|
||||
<Provider store={store}>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<DefaultCurrentAccountProvider>
|
||||
<StatProvider>
|
||||
<HelmetProvider>
|
||||
<PlFeHead />
|
||||
<PlFeLoad>
|
||||
<PlFeMount />
|
||||
</PlFeLoad>
|
||||
<NicoliumHead />
|
||||
<NicoliumLoad>
|
||||
<NicoliumMount />
|
||||
</NicoliumLoad>
|
||||
</HelmetProvider>
|
||||
</StatProvider>
|
||||
</DefaultCurrentAccountProvider>
|
||||
@@ -37,4 +37,4 @@ const PlFe: React.FC = () => (
|
||||
</>
|
||||
);
|
||||
|
||||
export { PlFe as default };
|
||||
export { Nicolium as default };
|
||||
@@ -5,7 +5,7 @@ import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
import * as BuildConfig from '@/build-config';
|
||||
import PlFe from '@/init/pl-fe';
|
||||
import Nicolium from '@/init/nicolium';
|
||||
import { printConsoleWarning } from '@/utils/console';
|
||||
|
||||
import '@fontsource/inter/200.css';
|
||||
@@ -22,7 +22,7 @@ import './styles/i18n.css';
|
||||
import './styles/application.scss';
|
||||
import './styles/tailwind.css';
|
||||
import './precheck';
|
||||
import ready from './ready';
|
||||
import ready from './init/ready';
|
||||
import { registerSW, lockSW } from './utils/sw';
|
||||
|
||||
if (BuildConfig.NODE_ENV === 'production') {
|
||||
@@ -35,5 +35,5 @@ ready(() => {
|
||||
const container = document.getElementById('plfe') as HTMLElement;
|
||||
const root = createRoot(container);
|
||||
|
||||
root.render(<PlFe />);
|
||||
root.render(<Nicolium />);
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Shamelessly stolen from Sharkey
|
||||
// https://activitypub.software/TransFem-org/Sharkey/-/blob/develop/packages/frontend/src/style.scss
|
||||
|
||||
.plfe-mfm {
|
||||
.⁂--mfm {
|
||||
._mfm_blur_ {
|
||||
filter: blur(6px);
|
||||
transition: filter 0.3s;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { generateAccent, generateNeutral } from '@/utils/theme';
|
||||
|
||||
import type { TailwindColorPalette } from '@/types/colors';
|
||||
|
||||
type PlFeColors = Record<string, Record<string, string>>;
|
||||
type FrontendColors = Record<string, Record<string, string>>;
|
||||
|
||||
/** Check if the value is a valid hex color */
|
||||
const isHex = (value: any): boolean => /^#([0-9A-F]{3}){1,2}$/i.test(value);
|
||||
@@ -55,7 +55,7 @@ const toTailwind = (config: {
|
||||
accentColor: string | null;
|
||||
colors: Record<string, Record<string, string>>;
|
||||
}): Record<string, Record<string, string> | string> => {
|
||||
const colors: PlFeColors = config.colors;
|
||||
const colors: FrontendColors = config.colors;
|
||||
const basicColors = fromBasicColors(config);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user