Repository navigation
Expand file tree
/
Copy pathsubmit_pr.sh
More file actions
155 lines (131 loc) · 5.24 KB
/
Copy pathsubmit_pr.sh
File metadata and controls
155 lines (131 loc) · 5.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/usr/bin/env bash
# =============================================================================
# submit_pr.sh – Mac / Linux
#
# Resolves issues #592 #593 #594 #595 in one branch.
#
# Usage:
# 1. Copy this script into the ROOT of your local SplitNaira clone.
# 2. Copy the entire "frontend/" folder output next to this script
# (or keep the folder structure from the delivery zip).
# 3. Run: bash submit_pr.sh
# =============================================================================
set -euo pipefail
# ─── Config ──────────────────────────────────────────────────────────────────
BRANCH="feat/ui-issues-592-593-594-595"
SOURCE_DIR="$(cd "$(dirname "$0")/frontend" && pwd)" # files sitting next to script
COMMIT_MSG='feat(ui): resolve issues #592 #593 #594 #595
#592 – split-app.tsx god component decomposed into SplitAppContext + 5 modal files
#593 – polished WalletButton component with avatar, dropdown, mobile chip
#594 – DashboardView empty state + consistent skeleton loading
#595 – DashboardLayout wired as canonical app shell via AppShellContext'
# ─────────────────────────────────────────────────────────────────────────────
echo ""
echo "========================================"
echo " SplitNaira – PR branch setup"
echo "========================================"
echo ""
# 0. Sanity
if [ ! -f "package.json" ]; then
echo "ERROR: Run this script from the ROOT of the SplitNaira repo."
exit 1
fi
if [ ! -d "$SOURCE_DIR" ]; then
echo "ERROR: Cannot find the 'frontend/' output folder next to this script."
echo " Expected: $SOURCE_DIR"
exit 1
fi
# 1. Up-to-date main
echo "[1/7] Pulling latest main…"
git checkout main
git pull origin main
# 2. Create / reset branch
echo "[2/7] Creating branch: $BRANCH"
if git show-ref --verify --quiet "refs/heads/$BRANCH"; then
echo " Already exists – resetting to main."
git checkout "$BRANCH"
git reset --hard main
else
git checkout -b "$BRANCH"
fi
# 3. Helper: copy a file, creating parent dirs as needed
copy_file() {
local src="$1"
local dest="$2"
mkdir -p "$(dirname "$dest")"
cp "$src" "$dest"
echo " ✓ $dest"
}
echo "[3/7] Copying new/modified source files…"
# ── Issue #595: AppShellContext (new)
copy_file \
"$SOURCE_DIR/src/context/AppShellContext.tsx" \
"frontend/src/context/AppShellContext.tsx"
# ── Issue #592: SplitAppContext (new)
copy_file \
"$SOURCE_DIR/src/context/SplitAppContext.tsx" \
"frontend/src/context/SplitAppContext.tsx"
# ── Issue #593: WalletButton (new)
copy_file \
"$SOURCE_DIR/src/components/WalletButton.tsx" \
"frontend/src/components/WalletButton.tsx"
# ── Issue #594: EmptyState (new)
copy_file \
"$SOURCE_DIR/src/components/EmptyState.tsx" \
"frontend/src/components/EmptyState.tsx"
# ── Issue #594: DashboardView (modified)
copy_file \
"$SOURCE_DIR/src/components/dashboard/DashboardView.tsx" \
"frontend/src/components/dashboard/DashboardView.tsx"
# ── Issue #592: modal extractions (new)
for modal in DistributeConfirmModal LockConfirmModal DepositModal PauseConfirmModal MetadataEditModal; do
copy_file \
"$SOURCE_DIR/src/components/modals/${modal}.tsx" \
"frontend/src/components/modals/${modal}.tsx"
done
# ── Issue #592 #593 #595: split-app.tsx (modified)
copy_file \
"$SOURCE_DIR/src/components/split-app.tsx" \
"frontend/src/components/split-app.tsx"
# ── Issue #595: DashboardLayout (modified)
copy_file \
"$SOURCE_DIR/src/components/DashboardLayout.tsx" \
"frontend/src/components/DashboardLayout.tsx"
# ── Issue #595: locale page (modified)
copy_file \
"$SOURCE_DIR/src/app/[locale]/page.tsx" \
"frontend/src/app/[locale]/page.tsx"
# 4. (Optional) quick type-check — comment out if no local toolchain
echo "[4/7] Running type-check (skipping – uncomment if needed)…"
# cd frontend && npx tsc --noEmit && cd ..
# 5. Stage
echo "[5/7] Staging all changes…"
git add \
"frontend/src/context/AppShellContext.tsx" \
"frontend/src/context/SplitAppContext.tsx" \
"frontend/src/components/WalletButton.tsx" \
"frontend/src/components/EmptyState.tsx" \
"frontend/src/components/dashboard/DashboardView.tsx" \
"frontend/src/components/modals/DistributeConfirmModal.tsx" \
"frontend/src/components/modals/LockConfirmModal.tsx" \
"frontend/src/components/modals/DepositModal.tsx" \
"frontend/src/components/modals/PauseConfirmModal.tsx" \
"frontend/src/components/modals/MetadataEditModal.tsx" \
"frontend/src/components/split-app.tsx" \
"frontend/src/components/DashboardLayout.tsx" \
"frontend/src/app/[locale]/page.tsx"
# 6. Commit
echo "[6/7] Committing…"
git commit -m "$COMMIT_MSG"
# 7. Push
echo "[7/7] Pushing to origin…"
git push -u origin "$BRANCH"
echo ""
echo "========================================"
echo " Done! Open your PR at:"
echo " https://github.com/Godsmiracle001/SplitNaira/compare/$BRANCH"
echo ""
echo " PR title:"
echo " feat(ui): resolve issues #592 #593 #594 #595"
echo "========================================"
echo ""