Skip to content

Commit

Permalink
purplesky patches 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Oct 20, 2024
1 parent 72270fd commit 3ada085
Show file tree
Hide file tree
Showing 37 changed files with 284 additions and 125 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake .
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ module.exports = {
'eslint-plugin-react-compiler',
],
rules: {
// purplesky hacks
'@typescript-eslint/no-unused-vars': 'warn',
'no-unreachable': 'warn',
// Temporary until https://github.com/facebook/react-native/pull/43756 gets into a release.
'prettier/prettier': 0,
'react/no-unescaped-entities': 0,
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,7 @@ src/locale/locales/**/*.js

# ogcard assets
bskyogcard/src/assets/fonts/noto-*

## purplesky
# Nix
.direnv
8 changes: 4 additions & 4 deletions app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ module.exports = function (config) {
return {
expo: {
version: VERSION,
name: 'Bluesky',
name: 'Purplesky',
slug: 'bluesky',
scheme: 'bluesky',
owner: 'blueskysocial',
owner: 'aagaming',
runtimeVersion: {
policy: 'appVersion',
},
orientation: 'portrait',
icon: './assets/icon.png',
userInterfaceStyle: 'automatic',
splash: SPLASH_CONFIG,
splash: DARK_SPLASH_CONFIG,
// hsl(211, 99%, 53%), same as palette.default.brandText
primaryColor: '#1083fe',
primaryColor: '#cba6f7',
ios: {
supportsTablet: false,
bundleIdentifier: 'xyz.blueskyweb.app',
Expand Down
Binary file added assets/favicon-orig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/favicon.xcf
Binary file not shown.
15 changes: 15 additions & 0 deletions assets/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "Purplesky",
"name": "Purplesky",
"icons": [
{
"src": "favicon.png",
"sizes": "512x512 192x192 64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#cba6f7",
"background_color": "#1e1627"
}
2 changes: 1 addition & 1 deletion bskyweb/embedr-static/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# codes are used for rate-limiting. Up to a handful concurrent requests should
# be ok.
User-Agent: *
Allow: /
Disallow: /
2 changes: 1 addition & 1 deletion bskyweb/static/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# codes are used for rate-limiting. Up to a handful concurrent requests should
# be ok.
User-Agent: *
Allow: /
Disallow: /
5 changes: 2 additions & 3 deletions bskyweb/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
<!--
Preconnect to essential domains
-->
<link rel="preconnect" href="https://bsky.social">
<link rel="preconnect" href="https://bsky.network">
<link rel="preconnect" href="https://aagaming.me">
<title>{%- block head_title -%}Bluesky{%- endblock -%}</title>

<!-- Hello Humans! API docs at https://atproto.com -->
Expand Down Expand Up @@ -99,7 +98,7 @@
<div id="root">
<div id="splash">
<!-- Bluesky SVG -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 320"><path fill="#0085ff" d="M180 142c-16.3-31.7-60.7-90.8-102-120C38.5-5.9 23.4-1 13.5 3.4 2.1 8.6 0 26.2 0 36.5c0 10.4 5.7 84.8 9.4 97.2 12.2 41 55.7 55 95.7 50.5-58.7 8.6-110.8 30-42.4 106.1 75.1 77.9 103-16.7 117.3-64.6 14.3 48 30.8 139 116 64.6 64-64.6 17.6-97.5-41.1-106.1 40 4.4 83.5-9.5 95.7-50.5 3.7-12.4 9.4-86.8 9.4-97.2 0-10.3-2-27.9-13.5-33C336.5-1 321.5-6 282 22c-41.3 29.2-85.7 88.3-102 120Z"/></svg>
<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 320"><path fill="#0085ff" d="M180 142c-16.3-31.7-60.7-90.8-102-120C38.5-5.9 23.4-1 13.5 3.4 2.1 8.6 0 26.2 0 36.5c0 10.4 5.7 84.8 9.4 97.2 12.2 41 55.7 55 95.7 50.5-58.7 8.6-110.8 30-42.4 106.1 75.1 77.9 103-16.7 117.3-64.6 14.3 48 30.8 139 116 64.6 64-64.6 17.6-97.5-41.1-106.1 40 4.4 83.5-9.5 95.7-50.5 3.7-12.4 9.4-86.8 9.4-97.2 0-10.3-2-27.9-13.5-33C336.5-1 321.5-6 282 22c-41.3 29.2-85.7 88.3-102 120Z"/></svg> -->
</div>
</div>

Expand Down
61 changes: 61 additions & 0 deletions flake.lock

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

27 changes: 27 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = {
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
in {
devShells.default = pkgs.mkShell {
name = "purplesky-dev";
packages = with pkgs; [
go
nodejs_22
yarn
nodePackages.wrangler
];
};
});
}
97 changes: 55 additions & 42 deletions src/App.web.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import '#/purplesky'
import '#/lib/sentry' // must be near top
import '#/view/icons'
import './style.css'

import React, {useEffect, useState} from 'react'
import {KeyboardProvider} from 'react-native-keyboard-controller'
import {RootSiblingParent} from 'react-native-root-siblings'
import {SafeAreaProvider} from 'react-native-safe-area-context'
import {
initialWindowMetrics,
SafeAreaProvider,
} from 'react-native-safe-area-context'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'

Expand Down Expand Up @@ -57,6 +61,7 @@ import {NuxDialogs} from '#/components/dialogs/nuxs'
import {useStarterPackEntry} from '#/components/hooks/useStarterPackEntry'
import {Provider as IntentDialogProvider} from '#/components/intents/IntentDialogs'
import {Provider as PortalProvider} from '#/components/Portal'
import {Splash} from '#/Splash'
import {BackgroundNotificationPreferencesProvider} from '../modules/expo-background-notification-handler/src/BackgroundNotificationHandlerProvider'

/**
Expand Down Expand Up @@ -105,48 +110,48 @@ function InnerApp() {
<KeyboardProvider enabled={false}>
<Alf theme={theme}>
<ThemeProvider theme={theme}>
<RootSiblingParent>
<VideoVolumeProvider>
<ActiveVideoProvider>
<React.Fragment
// Resets the entire tree below when it changes:
key={currentAccount?.did}>
<QueryProvider currentDid={currentAccount?.did}>
<ComposerProvider>
<StatsigProvider>
<MessagesProvider>
{/* LabelDefsProvider MUST come before ModerationOptsProvider */}
<LabelDefsProvider>
<ModerationOptsProvider>
<LoggedOutViewProvider>
<SelectedFeedProvider>
<HiddenRepliesProvider>
<UnreadNotifsProvider>
<BackgroundNotificationPreferencesProvider>
<MutedThreadsProvider>
<SafeAreaProvider>
<Splash isReady={isReady && hasCheckedReferrer}>
<RootSiblingParent>
<VideoVolumeProvider>
<ActiveVideoProvider>
<React.Fragment
// Resets the entire tree below when it changes:
key={currentAccount?.did}>
<QueryProvider currentDid={currentAccount?.did}>
<ComposerProvider>
<StatsigProvider>
<MessagesProvider>
{/* LabelDefsProvider MUST come before ModerationOptsProvider */}
<LabelDefsProvider>
<ModerationOptsProvider>
<LoggedOutViewProvider>
<SelectedFeedProvider>
<HiddenRepliesProvider>
<UnreadNotifsProvider>
<BackgroundNotificationPreferencesProvider>
<MutedThreadsProvider>
<ProgressGuideProvider>
<Shell />
<NuxDialogs />
</ProgressGuideProvider>
</SafeAreaProvider>
</MutedThreadsProvider>
</BackgroundNotificationPreferencesProvider>
</UnreadNotifsProvider>
</HiddenRepliesProvider>
</SelectedFeedProvider>
</LoggedOutViewProvider>
</ModerationOptsProvider>
</LabelDefsProvider>
</MessagesProvider>
</StatsigProvider>
</ComposerProvider>
</QueryProvider>
<ToastContainer />
</React.Fragment>
</ActiveVideoProvider>
</VideoVolumeProvider>
</RootSiblingParent>
</MutedThreadsProvider>
</BackgroundNotificationPreferencesProvider>
</UnreadNotifsProvider>
</HiddenRepliesProvider>
</SelectedFeedProvider>
</LoggedOutViewProvider>
</ModerationOptsProvider>
</LabelDefsProvider>
</MessagesProvider>
</StatsigProvider>
</ComposerProvider>
</QueryProvider>
<ToastContainer />
</React.Fragment>
</ActiveVideoProvider>
</VideoVolumeProvider>
</RootSiblingParent>
</Splash>
</ThemeProvider>
</Alf>
</KeyboardProvider>
Expand Down Expand Up @@ -183,9 +188,17 @@ function App() {
<LightboxStateProvider>
<PortalProvider>
<StarterPackProvider>
<IntentDialogProvider>
<InnerApp />
</IntentDialogProvider>
<SafeAreaProvider
initialMetrics={{
top: 0,
bottom: 0,
left: 0,
right: 0,
}}>
<IntentDialogProvider>
<InnerApp />
</IntentDialogProvider>
</SafeAreaProvider>
</StarterPackProvider>
</PortalProvider>
</LightboxStateProvider>
Expand Down
37 changes: 21 additions & 16 deletions src/Splash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,25 @@ import {Image} from 'expo-image'
import * as SplashScreen from 'expo-splash-screen'
import MaskedView from '@react-native-masked-view/masked-view'

import {isAndroid} from '#/platform/detection'
import {isAndroid, isWeb} from '#/platform/detection'
import {Logotype} from '#/view/icons/Logotype'
// @ts-ignore
import splashImagePointer from '../assets/splash.png'
// @ts-ignore
import darkSplashImagePointer from '../assets/splash-dark.png'
const splashImageUri = RNImage.resolveAssetSource(splashImagePointer).uri
const darkSplashImageUri = RNImage.resolveAssetSource(
darkSplashImagePointer,
).uri
import {useTheme} from './lib/ThemeContext'
const splashImageUri = isWeb
? splashImagePointer
: RNImage.resolveAssetSource(splashImagePointer).uri
const darkSplashImageUri = isWeb
? darkSplashImagePointer
: RNImage.resolveAssetSource(darkSplashImagePointer).uri

export const Logo = React.forwardRef(function LogoImpl(props: SvgProps, ref) {
const width = 1000
const height = width * (67 / 64)
return (
<Svg
fill="none"
// @ts-ignore it's fiiiiine
ref={ref}
viewBox="0 0 64 66"
style={[{width, height}, props.style]}>
<Svg fill="none" viewBox="0 0 64 66" ref={ref} style={{width, height}}>
<Path
fill={props.fill || '#fff'}
d="M13.873 3.77C21.21 9.243 29.103 20.342 32 26.3v15.732c0-.335-.13.043-.41.858-1.512 4.414-7.418 21.642-20.923 7.87-7.111-7.252-3.819-14.503 9.125-16.692-7.405 1.252-15.73-.817-18.014-8.93C1.12 22.804 0 8.431 0 6.488 0-3.237 8.579-.18 13.873 3.77ZM50.127 3.77C42.79 9.243 34.897 20.342 32 26.3v15.732c0-.335.13.043.41.858 1.512 4.414 7.418 21.642 20.923 7.87 7.111-7.252 3.819-14.503-9.125-16.692 7.405 1.252 15.73-.817 18.014-8.93C62.88 22.804 64 8.431 64 6.488 64-3.237 55.422-.18 50.127 3.77Z"
Expand Down Expand Up @@ -180,18 +178,24 @@ export function Splash(props: React.PropsWithChildren<Props>) {

const logoAnimations =
reduceMotion === true ? reducedLogoAnimation : logoAnimation
const t = useTheme()
// special off-spec color for dark mode
const logoBg = isDarkMode ? '#0F1824' : '#fff'
const logoBg = t.palette.default.background

return (
<View style={{flex: 1}} onLayout={onLayout}>
<View
style={{flex: 1, overflow: isAnimationComplete ? 'visible' : 'hidden'}}
onLayout={onLayout}>
{!isAnimationComplete && (
<View style={StyleSheet.absoluteFillObject}>
<Image
accessibilityIgnoresInvertColors
onLoadEnd={onLoadEnd}
source={{uri: isDarkMode ? darkSplashImageUri : splashImageUri}}
style={StyleSheet.absoluteFillObject}
style={[
StyleSheet.absoluteFillObject,
{filter: 'hue-rotate(56deg)'},
]}
/>

<Animated.View
Expand All @@ -213,10 +217,11 @@ export function Splash(props: React.PropsWithChildren<Props>) {
)}

{isReady &&
(isAndroid || reduceMotion === true ? (
(isWeb || isAndroid || reduceMotion === true ? (
// Use a simple fade on older versions of android (work around a bug)
<>
<Animated.View style={[{flex: 1}, appAnimation]}>
<Animated.View
style={[{flex: 1}, !isAnimationComplete && appAnimation]}>
{props.children}
</Animated.View>

Expand Down
Loading

0 comments on commit 3ada085

Please sign in to comment.