Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from powersync-ja/formatting_and_fixes
Browse files Browse the repository at this point in the history
Fix font in YJS demo
  • Loading branch information
cahofmeyr authored Jan 12, 2024
2 parents df16dc1 + 2602c51 commit 7b3c430
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 56 deletions.
8 changes: 6 additions & 2 deletions demos/powersync-supabase-yjs-text-collab-demo/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = withImages({
images: {
disableStaticImages: true
},
webpack: (config, { buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }) => {
webpack: (config, { isServer }) => {
if (isServer) {
return config;
}
Expand All @@ -16,7 +16,11 @@ module.exports = withImages({
rules: [
...config.module.rules,
{
test: /\.scss$/,
test: /\.css/,
use: ['style-loader', 'css-loader']
},
{
test: /\.scss/,
use: ['style-loader', 'css-loader', 'sass-loader']
}
]
Expand Down
1 change: 1 addition & 0 deletions demos/powersync-supabase-yjs-text-collab-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@tiptap/extension-task-list": "2.1.13",
"@tiptap/react": "2.1.13",
"@tiptap/starter-kit": "2.1.13",
"lato-font": "^3.0.0",
"d3": "^7.3.0",
"fast-glob": "^3.2.11",
"formik": "^2.4.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
'use client';

import _ from 'lodash';
import React, { useCallback, useEffect, useState, useRef, useMemo } from 'react';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { useSupabase } from '@/components/providers/SystemProvider';
import { usePowerSync, usePowerSyncWatchedQuery } from '@journeyapps/powersync-react';
import {
Box,
Button,
Container,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
List,
TextField,
Typography,
styled
} from '@mui/material';
import Fab from '@mui/material/Fab';
import AddIcon from '@mui/icons-material/Add';
import { Box, Container, Typography } from '@mui/material';
import { useRouter } from 'next/navigation';
import { v4 as uuidv4 } from 'uuid';
import { b64ToUint8Array, Uint8ArrayTob64 } from '@/library/binary-utils';

import * as Y from 'yjs';
import Collaboration from '@tiptap/extension-collaboration';
import CollaborationCursor from '@tiptap/extension-collaboration-cursor';
import Highlight from '@tiptap/extension-highlight';
import TaskItem from '@tiptap/extension-task-item';
import TaskList from '@tiptap/extension-task-list';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ body {
min-height: 100vh;
margin: 0;
background: var(--background-rgb);
font-family: Lato !important;
font-weight: 400 !important;;
}
37 changes: 3 additions & 34 deletions demos/powersync-supabase-yjs-text-collab-demo/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,52 +1,21 @@
'use client';

import React from 'react';
import {
AppBar,
Box,
CssBaseline,
Divider,
Drawer,
IconButton,
List,
ListItem,
ListItemButton,
ListItemIcon,
ListItemText,
Toolbar,
Typography,
styled
} from '@mui/material';
import MenuIcon from '@mui/icons-material/Menu';
import WifiIcon from '@mui/icons-material/Wifi';
import SignalWifiOffIcon from '@mui/icons-material/SignalWifiOff';
import ChecklistRtlIcon from '@mui/icons-material/ChecklistRtl';
import ExitToAppIcon from '@mui/icons-material/ExitToApp';
import TerminalIcon from '@mui/icons-material/Terminal';

import { usePowerSync } from '@journeyapps/powersync-react';
import { useSupabase } from '@/components/providers/SystemProvider';

import { useRouter } from 'next/navigation';
import Image from 'next/image';
import type { Metadata } from 'next';
import { CssBaseline } from '@mui/material';

import { ThemeProviderContainer } from '@/components/providers/ThemeProviderContainer';
import { DynamicSystemProvider } from '@/components/providers/DynamicSystemProvider';

import './globals.scss';

import { Lato } from 'next/font/google';

const font = Lato({ subsets: ['latin'], display: 'swap', weight: '400' });
import 'lato-font';

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<title>PowerSync Yjs CRDT Text Collaboration Demo</title>
</head>
<body className={font.className}>
<body>
<CssBaseline />
<ThemeProviderContainer>
<DynamicSystemProvider>{children}</DynamicSystemProvider>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use client';
import _ from 'lodash';
import React from 'react';
import { usePowerSyncWatchedQuery } from '@journeyapps/powersync-react';
import { Box, Button, Grid, TextField, styled } from '@mui/material';
Expand Down
7 changes: 7 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7b3c430

Please sign in to comment.