Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

スケジュール画面のモバイル対応 #165

Merged
merged 7 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions app/views/schedules/_card.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= turbo_frame_tag schedule do %>
<div class="flex h-full">
<div class="w-full min-w-[400px] h-fit p-4 shadow-[0_1px_2px_0_rgba(3,3,2,0.3)] rounded-md bg-white">
<div class="w-full sm:min-w-[400px] h-fit p-4 shadow-[0_1px_2px_0_rgba(3,3,2,0.3)] rounded-md bg-white">
<div class="flex flex-col justify-between items-start">
<% schedule.speakers.each do |speaker| %>
<div class="flex items-center m-w-80 mb-2">
Expand All @@ -10,11 +10,11 @@
<% end %>

<% unless mode == :team %>
<div class="flex">
<div class="flex flex-row justify-center items-center px-3 mr-2 h-6 bg-[rgb(248,247,246)] border border-solid border-[rgb(214,211,208)] box-border rounded-[100px] text-sm text-[rgb(35,34,31)]">
<div class="flex flex-wrap gap-2">
<div class="flex flex-row justify-center items-center px-3 h-6 bg-[rgb(248,247,246)] border border-solid border-[rgb(214,211,208)] box-border rounded-[100px] text-sm text-[rgb(35,34,31)]">
<span class="text-[rgb(112,109,101)]">Lang: </span><span class="ml-2"><%= schedule.language %></span>
</div>
<div class="flex flex-row justify-center items-center px-3 mr-2 h-6 bg-[rgb(248,247,246)] border border-solid border-[rgb(214,211,208)] box-border rounded-[100px] text-sm text-[rgb(35,34,31)]">
<div class="flex flex-row justify-center items-center px-3 h-6 bg-[rgb(248,247,246)] border border-solid border-[rgb(214,211,208)] box-border rounded-[100px] text-sm text-[rgb(35,34,31)]">
<span class="text-[rgb(112,109,101)]">Track: </span><span class="ml-2"><%= schedule.track.name %></span>
</div>
</div>
Expand Down Expand Up @@ -71,7 +71,7 @@
<div class="font-xs mt-2 text-[rgb(112,109,101)]">
<span data-word-counter-target="counter"></span>/<%= plan_memo_max_length %>
</div>
</div>
</div
yamakeeeeeeeeen marked this conversation as resolved.
Show resolved Hide resolved
</div>
<div class="border-t-[1px] border-[rgb(214,211,208)] flex flex-col py-4 px-6">
<div class="flex justify-end">
Expand Down
8 changes: 5 additions & 3 deletions app/views/schedules/_table_row.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
<tr class="align-baseline" id="<%= row.turbo_stream_id %>">
<th class="py-2 px-0 align-baseline">
<div class="flex flex-col gap-1">
<div class="flex items-center">
<div class="flex items-center my-4">
<p class="text-xl font-normal mr-4 shrink-0"><%= row.start_end %></p>
<hr class="w-full h-[1px] mr-4 bg-[rgb(214,211,208)] border-none">
</div>
<p class="text-sm font-bold text-[rgb(112,109,101)] text-left"><%= row.timezone %></p>
<p class="hidden sm:block text-sm font-bold text-[rgb(112,109,101)] text-left"><%= row.timezone %></p>
</div>
</th>
<% track_list.each do |track| %>
<% if row.tracks[track] %>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

row.tracks[track]がない場合にpaddingを持ったdivが作られてしまうので修正しました

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ意図的な挙動で、例えばPCで横表示するときにA, B, Cのトラックがアリ、AとCだけスケジュールが設定されていたときに表示が崩れる気がします。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

なるほど、PCに影響が出ないようにモバイルの時に不要なスペースが出ないよう考えてみます!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<td>
<div class="p-2"><%= row.tracks[track] ? render("schedules/card", schedule: row.tracks[track], mode: :schedule, inactive: @selected) : nil %></div>
<div class="p-2"><%= render("schedules/card", schedule: row.tracks[track], mode: :schedule, inactive: @selected) %></div>
</td>
<% end %>
<% end %>
</tr>
7 changes: 6 additions & 1 deletion app/views/schedules/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<div class="mt-4 overflow-y-auto">
<% @schedule_table.days.each do |day| %>
<div id="schedule-<%= day %>" class="schedule-table hidden">
<table class="h-full w-full border-collapse border-spacing-0">
<table class="hidden sm:table h-full w-full border-collapse border-spacing-0">
<thead>
<th class="p-4 text-sm leading-4 border border-solid border-[rgb(214,211,208)] w-auto min-w-[184px] text-left"><%= I18n.t('table.start_end') %></th>
<% @schedule_table[day].track_list.each do |track| %>
Expand All @@ -52,6 +52,11 @@
<% end %>
</tbody>
</table>
<div class="sm:hidden">
<% @schedule_table[day].rows.each do |row| %>
<%= render partial: 'table_row', locals: { row: row, plan: @plan, track_list: @schedule_table[day].track_list } %>
<% end %>
</div>
</div>
<% end %>
</div>
Expand Down
Loading