Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ concurrency:

jobs:
code_review:
# Auto-run only on same-repo PRs. Fork PRs don't get EXPO_BOT_GITHUB_TOKEN
# under `pull_request`, so the review would fail anyway — skip cleanly
# instead of leaving a red check. Maintainers can review a fork PR
# manually via workflow_dispatch.
# Auto-run only on same-repo PRs to expo/expo. Fork PRs don't get
# EXPO_BOT_GITHUB_TOKEN under `pull_request`, so the review would fail
# anyway — skip cleanly instead of leaving a red check. Forks dispatching
# this workflow manually would also fail for the same reason; gate on
# `github.repository` to short-circuit.
if: >-
github.event_name == 'workflow_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
github.repository == 'expo/expo' &&
(github.event_name == 'workflow_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/commentator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
comment:
if: github.repository == 'expo/expo'
runs-on: ubuntu-24.04
steps:
- name: 👀 Checkout
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/development-client-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ concurrency:

jobs:
detox_e2e:
if: github.repository == 'expo/expo'
runs-on: ubuntu-24.04
strategy:
matrix:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/development-client-latest-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ concurrency:

jobs:
detox_latest_e2e:
if: github.repository == 'expo/expo'
runs-on: ubuntu-24.04
strategy:
matrix:
Expand Down Expand Up @@ -74,7 +75,7 @@ jobs:
path: packages/expo-dev-client/artifacts
- name: 🔔 Notify on Slack
uses: ./.github/actions/slack-notify
if: failure()
if: failure() && github.repository == 'expo/expo'
with:
webhook: ${{ secrets.slack_webhook_dev_client }}
channel: '#dev-clients'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docs-pr-destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ concurrency:

jobs:
docs-pr-destroy:
if: (github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'preview')) ||
(github.event.action == 'unlabeled' && github.event.label.name == 'preview')
if: github.repository == 'expo/expo' &&
((github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'preview')) ||
(github.event.action == 'unlabeled' && github.event.label.name == 'preview'))
runs-on: ubuntu-24.04
steps:
- name: 👀 Checkout
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ concurrency:

jobs:
docs-pr:
if: github.repository == 'expo/expo'
runs-on: ubuntu-24.04
steps:
- name: 👀 Checkout
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ concurrency:

jobs:
docs:
if: github.repository == 'expo/expo'
runs-on: ubuntu-24.04
steps:
- name: 👀 Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
run-on-issue-accepted:
runs-on: ubuntu-24.04
if: contains(github.event.issue.labels.*.name, 'Issue accepted')
if: github.repository == 'expo/expo' && contains(github.event.issue.labels.*.name, 'Issue accepted')
steps:
- name: 👀 Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/issue-opened.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
check-if-trusted:
if: github.repository == 'expo/expo'
runs-on: ubuntu-24.04
steps:
- uses: ./.github/actions/slack-notify
Expand All @@ -32,6 +33,7 @@ jobs:
})

validate:
if: github.repository == 'expo/expo'
runs-on: ubuntu-24.04
steps:
- name: 👀 Checkout
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
needs-repro:
runs-on: ubuntu-24.04
if: "${{ contains(github.event.label.name, 'incomplete issue: missing or invalid repro') }}"
if: "${{ github.repository == 'expo/expo' && contains(github.event.label.name, 'incomplete issue: missing or invalid repro') }}"
steps:
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:

needs-info:
runs-on: ubuntu-24.04
if: "${{ contains(github.event.label.name, 'incomplete issue: missing info') }}"
if: "${{ github.repository == 'expo/expo' && contains(github.event.label.name, 'incomplete issue: missing info') }}"
steps:
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
# expotools with EXPO_BOT_GITHUB_TOKEN, LINEAR_API_KEY, and OPENAI_API_KEY
# in env. Without the guard, applying an "issue accepted" label to a PR
# would trigger the same flow on a pull_request_target event.
if: github.event_name == 'issues' && github.event.label.name == 'issue accepted'
if: github.repository == 'expo/expo' && github.event_name == 'issues' && github.event.label.name == 'issue accepted'
steps:
- name: Comment on issue
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:

question:
runs-on: ubuntu-24.04
if: "${{ contains(github.event.label.name, 'invalid issue: question') }}"
if: "${{ github.repository == 'expo/expo' && contains(github.event.label.name, 'invalid issue: question') }}"
steps:
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:

feature-request:
runs-on: ubuntu-24.04
if: "${{ contains(github.event.label.name, 'invalid issue: feature request') }}"
if: "${{ github.repository == 'expo/expo' && contains(github.event.label.name, 'invalid issue: feature request') }}"
steps:
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
Expand All @@ -202,7 +202,7 @@ jobs:

third-party:
runs-on: ubuntu-24.04
if: "${{ contains(github.event.label.name, 'invalid issue: third-party library') }}"
if: "${{ github.repository == 'expo/expo' && contains(github.event.label.name, 'invalid issue: third-party library') }}"
steps:
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
Expand All @@ -229,7 +229,7 @@ jobs:
})
react-native-core:
runs-on: ubuntu-24.04
if: "${{ contains(github.event.label.name, 'invalid issue: react-native-core') }}"
if: "${{ github.repository == 'expo/expo' && contains(github.event.label.name, 'invalid issue: react-native-core') }}"
steps:
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
Expand All @@ -251,7 +251,7 @@ jobs:
})
comments-on-closed:
runs-on: ubuntu-24.04
if: "${{ github.event.label.name == 'Comments on closed issue' }}"
if: "${{ github.repository == 'expo/expo' && github.event.label.name == 'Comments on closed issue' }}"
steps:
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
Expand All @@ -273,7 +273,7 @@ jobs:
})
eas-build-troubleshooting:
runs-on: ubuntu-24.04
if: "${{ github.event.label.name == 'invalid issue: EAS Build troubleshooting' }}"
if: "${{ github.repository == 'expo/expo' && github.event.label.name == 'invalid issue: EAS Build troubleshooting' }}"
steps:
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
Expand All @@ -295,7 +295,7 @@ jobs:
})
version-bump:
runs-on: ubuntu-24.04
if: "${{ github.event.label.name == 'Version bump PR' }}"
if: "${{ github.repository == 'expo/expo' && github.event.label.name == 'Version bump PR' }}"
steps:
- uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-contributor-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ permissions:

jobs:
label:
if: github.repository == 'expo/expo'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ concurrency:
jobs:
test-suite-fingerprint:
runs-on: ubuntu-24.04
if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' }}
if: ${{ github.repository == 'expo/expo' && (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push') }}
# REQUIRED: limit concurrency when pushing main(default) branch to prevent conflict for this action to update its fingerprint database
concurrency: fingerprint-${{ github.event_name != 'pull_request' && 'main' || github.run_id }}
permissions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sync-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

jobs:
build:
if: github.repository == 'expo/expo'
runs-on: ubuntu-24.04
steps:
- name: 👀 Checkout
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import {
Box,
Button,
Column,
Host,
Snackbar,
SnackbarHost,
type SnackbarHostRef,
Text as ComposeText,
} from '@expo/ui/jetpack-compose';
import { align, fillMaxSize, fillMaxWidth, padding } from '@expo/ui/jetpack-compose/modifiers';
import * as React from 'react';

export default function SnackbarScreen() {
const defaultHostRef = React.useRef<SnackbarHostRef>(null);
const styledHostRef = React.useRef<SnackbarHostRef>(null);
const [lastResult, setLastResult] = React.useState<string>('');

const showShort = async () => {
const result = await defaultHostRef.current?.showSnackbar({
message: 'Item archived',
actionLabel: 'Undo',
duration: 'short',
});
setLastResult(`short: ${result ?? 'no host'}`);
};

const showWithDismissAction = async () => {
const result = await defaultHostRef.current?.showSnackbar({
message: 'New email received',
withDismissAction: true,
duration: 'long',
});
setLastResult(`long+dismiss: ${result ?? 'no host'}`);
};

const showIndefinite = async () => {
const result = await defaultHostRef.current?.showSnackbar({
message: 'Connection lost, tap to retry',
actionLabel: 'Retry',
duration: 'indefinite',
});
setLastResult(`indefinite: ${result ?? 'no host'}`);
};

const showStyled = async () => {
const result = await styledHostRef.current?.showSnackbar({
message: 'Saved with custom colors',
actionLabel: 'OK',
duration: 'short',
});
setLastResult(`styled: ${result ?? 'no host'}`);
};

return (
<Host style={{ flex: 1 }}>
<Box modifiers={[fillMaxSize()]}>
<Column verticalArrangement={{ spacedBy: 12 }} modifiers={[padding(16, 16, 16, 16)]}>
<ComposeText style={{ fontSize: 18, fontWeight: '600' }}>Default styling</ComposeText>
<Button onClick={showShort}>
<ComposeText>Show short snackbar with Undo</ComposeText>
</Button>
<Button onClick={showWithDismissAction}>
<ComposeText>Show long snackbar with dismiss icon</ComposeText>
</Button>
<Button onClick={showIndefinite}>
<ComposeText>Show indefinite snackbar with Retry</ComposeText>
</Button>

<ComposeText style={{ fontSize: 18, fontWeight: '600' }}>Custom styling</ComposeText>
<ComposeText>Pass a Snackbar child to SnackbarHost to override colors.</ComposeText>
<Button onClick={showStyled}>
<ComposeText>Show styled snackbar</ComposeText>
</Button>

<ComposeText>Last result: {lastResult || '-'}</ComposeText>
</Column>

<Box modifiers={[align('bottomCenter'), fillMaxWidth()]}>
<SnackbarHost ref={defaultHostRef} />
</Box>
<Box modifiers={[align('bottomCenter'), fillMaxWidth()]}>
<SnackbarHost ref={styledHostRef}>
<Snackbar
containerColor="#322F35"
contentColor="#E6E0E9"
actionContentColor="#D0BCFF"
dismissActionContentColor="#E6E0E9"
/>
</SnackbarHost>
</Box>
</Box>
</Host>
);
}

SnackbarScreen.navigationOptions = {
title: 'Snackbar',
};
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,14 @@ export const UIScreens = [
return optionalRequire(() => require('./SurfaceScreen'));
},
},
{
name: 'Snackbar component',
route: 'ui/snackbar',
options: {},
getComponent() {
return optionalRequire(() => require('./SnackbarScreen'));
},
},
{
name: 'Tooltip component',
route: 'ui/tooltip',
Expand Down
Loading
Loading