Skip to content

Commit dc95348

Browse files
Merge branch 'ship-button-checks' of https://github.com/JeffreyWangDev/flavortown into ship-button-checks
2 parents 1682de6 + 0b4ad60 commit dc95348

File tree

66 files changed

+1058
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1058
-337
lines changed

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,6 @@ gem "sentry-rails"
118118
# for pagination
119119
gem "pagy", "~> 43.2"
120120
gem "norairrecord"
121+
122+
gem "awesome_print"
123+
gem "activeinsights"

Gemfile.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ GEM
6363
activestorage (>= 6.1.4)
6464
activesupport (>= 6.1.4)
6565
marcel (>= 1.0.3)
66+
activeinsights (1.3.3)
67+
chartkick
68+
importmap-rails
69+
rails (>= 7.2)
6670
activejob (8.1.1)
6771
activesupport (= 8.1.1)
6872
globalid (>= 0.3.6)
@@ -101,6 +105,7 @@ GEM
101105
fiddle
102106
ast (2.4.3)
103107
attr_required (1.0.2)
108+
awesome_print (1.9.2)
104109
aws-eventstream (1.4.0)
105110
aws-partitions (1.1190.0)
106111
aws-sdk-core (3.239.2)
@@ -710,7 +715,9 @@ PLATFORMS
710715
DEPENDENCIES
711716
aasm
712717
active_storage_validations
718+
activeinsights
713719
annotaterb
720+
awesome_print
714721
aws-sdk-s3
715722
blazer
716723
blind_index

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ docker-compose run web bin/rails bundle install
3939
docker-compose run web bin/lint
4040
```
4141

42+
if its giving you a file not found error and you are on windows, try running these commands. They switch line endings to lf (linux) ones
43+
44+
This will reset all your code!
45+
46+
```
47+
git config --local core.autocrlf false
48+
git rm --cached -r .
49+
git reset --hard
50+
```
51+
52+
53+
4254
## i hate docker
4355

4456
weirdo, but okay, you gotta figure out how to get postgres running yourself bucko

app/assets/stylesheets/components/_kitchen_tutorial_steps.scss

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,60 @@
11
.tutorial-steps {
2+
position: relative;
3+
z-index: 1;
4+
25
&__header {
6+
display: flex;
7+
align-items: center;
8+
gap: var(--space-m);
39
margin-bottom: var(--space-xl);
10+
cursor: pointer;
11+
list-style: none;
12+
13+
&::-webkit-details-marker {
14+
display: none;
15+
}
16+
}
17+
18+
&__toggle-icon {
19+
display: flex;
20+
align-items: center;
21+
justify-content: center;
22+
transition: transform 0.2s ease;
23+
transform: rotate(-90deg);
24+
25+
svg {
26+
width: 20px;
27+
height: 20px;
28+
fill: var(--color-brown-500);
29+
}
30+
}
31+
32+
&[open] > &__header &__toggle-icon {
33+
transform: rotate(0deg);
34+
}
35+
36+
&__title {
37+
font-family: var(--font-family-jua);
38+
font-size: var(--font-size-l);
39+
color: var(--color-brown-500);
440
}
541

642
&__progress {
7-
margin-bottom: var(--space-l);
43+
display: flex;
44+
align-items: center;
45+
gap: var(--space-m);
46+
flex: 1;
847
}
948

1049
&__progress-text {
11-
display: block;
12-
margin-bottom: var(--space-s);
1350
font-family: var(--font-family-jua);
1451
font-size: var(--font-size-l);
1552
color: var(--color-brown-500);
53+
white-space: nowrap;
1654
}
1755

1856
&__progress-bar {
19-
width: 100%;
57+
flex: 1;
2058
height: 12px;
2159
background: var(--color-tan-300);
2260
border: 3px solid var(--color-brown-400);
@@ -26,7 +64,11 @@
2664

2765
&__progress-fill {
2866
height: 100%;
29-
background: linear-gradient(90deg, var(--color-green-400) 0%, var(--color-green-300) 100%);
67+
background: linear-gradient(
68+
90deg,
69+
var(--color-green-400) 0%,
70+
var(--color-green-300) 100%
71+
);
3072
transition: width 0.3s ease;
3173
border-radius: 999px;
3274
}
@@ -69,7 +111,7 @@
69111
}
70112

71113
&[data-tooltip]:hover::before {
72-
content: '';
114+
content: "";
73115
position: absolute;
74116
bottom: 120%;
75117
left: 50%;

app/assets/stylesheets/components/_post.scss

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
&__avatar {
5555
width: 48px;
5656
height: 48px;
57+
max-width: 48px;
58+
max-height: 48px;
5759
border-radius: 50%;
5860
background-color: var(--color-brown-300);
5961
display: grid;
@@ -83,6 +85,36 @@
8385
font-size: var(--font-size-l);
8486
}
8587

88+
&__duration {
89+
font-size: var(--font-size-m);
90+
font-weight: 600;
91+
color: var(--color-bg);
92+
opacity: 0.8;
93+
}
94+
95+
&__debug {
96+
background: rgba(0, 0, 0, 0.2);
97+
border-radius: var(--border-radius);
98+
padding: var(--space-s);
99+
font-size: var(--font-size-s);
100+
101+
summary {
102+
cursor: pointer;
103+
font-weight: 600;
104+
color: var(--color-bg);
105+
}
106+
107+
pre {
108+
margin: var(--space-s) 0 0;
109+
padding: var(--space-s);
110+
background: rgba(0, 0, 0, 0.3);
111+
border-radius: calc(var(--border-radius) / 2);
112+
overflow-x: auto;
113+
font-size: var(--font-size-xs);
114+
color: var(--color-tan-300);
115+
}
116+
}
117+
86118
&__body {
87119
font-size: var(--font-size-xl);
88120
line-height: 1.5;

app/assets/stylesheets/pages/projects/_new.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,24 @@
6262
padding-right: var(--space-xxl);
6363
gap: var(--space-m);
6464
}
65+
66+
&__time-preview {
67+
background: var(--color-green-100);
68+
border: 2px solid var(--color-green-300);
69+
border-radius: var(--border-radius);
70+
padding: var(--space-m) var(--space-l);
71+
text-align: center;
72+
73+
p {
74+
margin: 0;
75+
font-size: var(--font-size-l);
76+
color: var(--color-green-600);
77+
}
78+
79+
strong {
80+
color: var(--color-green-700);
81+
}
82+
}
6583
}
6684

6785
@media (max-width: 768px) {

app/assets/stylesheets/pages/shop/_my_orders.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@
4040
&__item {
4141
display: flex;
4242
flex-direction: column;
43-
background: linear-gradient(135deg, var(--color-bg-2) 0%, var(--color-bg) 100%);
43+
background: linear-gradient(
44+
135deg,
45+
var(--color-bg-2) 0%,
46+
var(--color-bg) 100%
47+
);
4448
border-radius: var(--border-radius);
4549
overflow: hidden;
4650
box-shadow: var(--shadow);
47-
transition: transform 0.2s ease, box-shadow 0.2s ease;
51+
transition:
52+
transform 0.2s ease,
53+
box-shadow 0.2s ease;
4854

4955
&:hover {
5056
transform: translateY(-2px);
@@ -164,7 +170,7 @@
164170
border: none;
165171
padding: 0;
166172
margin: 0;
167-
173+
168174
&:hover {
169175
color: var(--color-blue-300);
170176
text-decoration: underline;

app/components/hackatime_project_selector_component.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
data-attribute="<%= attribute %>"
55
data-project-icon-path="<%= project_icon_path %>"
66
data-close-icon-path="<%= close_icon_path %>"
7-
data-hackatime-project-selector-initial-projects-value="<%= initial_projects.to_json %>">
7+
data-hackatime-project-selector-initial-projects-value="<%= initial_projects.to_json %>"
8+
data-hackatime-project-selector-project-times-value="<%= project_times.to_json %>">
89
<label class="hackatime-project-selector__label"><%= label %></label>
910

1011
<div class="hackatime-project-selector__control">

app/components/hackatime_project_selector_component.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
class HackatimeProjectSelectorComponent < ViewComponent::Base
44
COLORS = %i[red blue green yellow].freeze
55

6-
attr_reader :label, :color, :subtitle, :form, :attribute, :projects
6+
attr_reader :label, :color, :subtitle, :form, :attribute, :projects, :project_times
77

8-
def initialize(label:, form:, attribute:, color: :blue, subtitle: nil, projects: [])
8+
def initialize(label:, form:, attribute:, color: :blue, subtitle: nil, projects: [], project_times: {})
99
@label = label
1010
@form = form
1111
@attribute = attribute
1212
@color = normalize_color(color)
1313
@subtitle = subtitle
1414
@projects = projects
15+
@project_times = project_times
1516
end
1617

1718
def input_classes

app/components/kitchen_tutorial_steps_component.rb

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ class KitchenTutorialStepsComponent < ApplicationComponent
44
def initialize(tutorial_steps:, completed_steps:, current_user:)
55
@tutorial_steps = tutorial_steps
66
@completed_steps = completed_steps
7-
@current_user = current_user
87
end
98

109
def view_template
11-
div(class: "tutorial-steps") do
12-
div(class: "tutorial-steps__header") do
10+
details(class: "tutorial-steps", open: !all_completed?) do
11+
summary(class: "tutorial-steps__header") do
12+
span(class: "tutorial-steps__toggle-icon") do
13+
raw helpers.inline_svg_tag("icons/chevron-down.svg", alt: "")
14+
end
15+
span(class: "tutorial-steps__title") { "Tutorial" }
1316
div(class: "tutorial-steps__progress") do
14-
span(class: "tutorial-steps__progress-text") { "#{completed_count} of #{total_count} completed" }
17+
span(class: "tutorial-steps__progress-text") { "#{completed_count} of #{total_count}" }
1518
div(class: "tutorial-steps__progress-bar") do
1619
div(class: "tutorial-steps__progress-fill", style: "width: #{progress_percentage}%")
1720
end
@@ -26,6 +29,8 @@ def view_template
2629
end
2730
end
2831

32+
def all_completed? = completed_count == total_count
33+
2934
private
3035

3136
def render_step_card(step)
@@ -60,9 +65,16 @@ def render_cta(step, completed, deps_ok, verb)
6065
return unless link
6166

6267
div(class: "state-card__cta") do
63-
button_to link, method: verb, form_class: "btn btn--borderless btn--bg_yellow", data: { turbo: false } do
64-
span { "Start" }
65-
raw helpers.inline_svg_tag("icons/right-arrow.svg")
68+
if verb == :get
69+
a(href: link, class: "btn btn--borderless btn--bg_yellow", data: { turbo: false }) do
70+
span { "Start" }
71+
raw helpers.inline_svg_tag("icons/right-arrow.svg")
72+
end
73+
else
74+
button_to link, method: verb, form_class: "btn btn--borderless btn--bg_yellow", data: { turbo: false } do
75+
span { "Start" }
76+
raw helpers.inline_svg_tag("icons/right-arrow.svg")
77+
end
6678
end
6779
end
6880
elsif !deps_ok

0 commit comments

Comments
 (0)