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
16 changes: 10 additions & 6 deletions app/pages/map/MapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,11 @@ const BuildingList = ({
<span className="block font-medium leading-snug text-ink">
{building.name}
</span>
<span className="mt-0.5 line-clamp-1 block text-xs text-muted">
{building.desc}
</span>
{building.desc ? (
<span className="mt-0.5 line-clamp-1 block text-xs text-muted">
{building.desc}
</span>
) : null}
</span>
</button>
);
Expand Down Expand Up @@ -833,9 +835,11 @@ const MapPage = () => {
<h2 className="m-0 font-display text-lg font-semibold leading-tight">
{selected.name}
</h2>
<p className="mt-1 mb-0 line-clamp-2 text-xs leading-relaxed text-muted">
{selected.desc}
</p>
{selected.desc ? (
<p className="mt-1 mb-0 line-clamp-2 text-xs leading-relaxed text-muted">
{selected.desc}
</p>
) : null}
</div>
<button
type="button"
Expand Down
48 changes: 48 additions & 0 deletions app/pages/map/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,46 @@ export const BUILDINGS = [
coord: [106.464181, 29.567418],
desc: 'A校园正门',
},
{
id: 'a_hospital_01',
name: '校医院',
category: 'hospital',
campusId: 'a',
coord: [106.472216, 29.563117],
desc: '',
},
{
id: 'a_busstation_01',
name: '后门校车站',
category: 'busstation',
campusId: 'a',
coord: [106.471154, 29.562414],
desc: '',
},
{
id: 'a_busstation_02',
name: '钟塔校车站',
category: 'busstation',
campusId: 'a',
coord: [106.467243, 29.567197],
desc: '',
},
{
id: 'a_landmark_01',
name: '钟塔',
category: 'landmark',
campusId: 'a',
coord: [106.467473, 29.567312],
desc: '',
},
{
id: 'a_landmark_02',
name: '防空洞爱国教育基地',
category: 'landmark',
campusId: 'a',
coord: [106.46731, 29.56792],
desc: '',
},
{
id: 'a_food_01',
name: '中渡芋圆',
Expand All @@ -1072,6 +1112,14 @@ export const BUILDINGS = [
coord: [106.472875, 29.564787],
desc: 'A校园附近甜品店',
},
{
id: 'a_food_02',
name: '曾一刀私房牛肉面',
category: 'food',
campusId: 'a',
coord: [106.462373, 29.558773],
desc: '这是重庆一三八高中生下课吃面的常驻地,笔者最推荐其原汤牛肉牛筋混合韭叶面加蛋,其中“原汤”并不指浅白色的牛骨汤,而是指浮于汤面上的那层微辣牛油,这是整碗面的精髓;单吃牛肉太柴,单吃牛筋太腻,牛肉牛筋混合这一搭配折中两者优缺,让吃面也不再单调;韭叶面由其形状酷似韭菜叶子得名,源于四川达州大竹县,其优点是在吃面时可裹上更多红油,牛油香味更浓;在吃面时煎蛋埋于碗底,面吃到一半时,煎蛋已吸饱汤汁,此时再吃味更美(๑´ڡ`๑)(from 巧克力大王)',
},
{
id: 'b_teaching_01',
name: '第二综合楼',
Expand Down
2 changes: 1 addition & 1 deletion app/tests/mapData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {

describe('campus map data', () => {
it('matches the published location count', () => {
expect(BUILDINGS).toHaveLength(132);
expect(BUILDINGS).toHaveLength(138);
expect(
(BUILDINGS as readonly Building[]).some(
(building) => building.campusId === 'c',
Expand Down
Loading