Add the Shipping Cutoff e-commerce template (`ecommerce-shipping-cutoff`)

未關閉
#451 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
78/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
typescript
領域
design

研究方向

Start with src/templates/event/countdown.ts for the date block and src/templates/ecommerce/coupon-code.ts for optional promotional content. Create src/templates/ecommerce/shipping-cutoff.ts, then re-export it from src/templates/ecommerce/index.ts and register it in src/templates/registry.ts. Done means the template handles blank options, centering, font shrinking and truncation, and readable light backgrounds as listed in the acceptance criteria.

由索引模型根據 Issue 內容生成。

描述

good first issue templates

Part of #5. For stores posting the last day to order before a holiday or a launch date, which is most of December for anyone who ships physical things.

Idea
A calendar-style date block on the left, the month on top ("DEC") and the day large under it ("18"). On the right, the heading ("Last day to order for holiday delivery") and up to three shipping options, each a method and its own cutoff on one line: "Standard / Order by Dec 15", "Express / Order by Dec 19", "Next day / Order by Dec 21". An optional note under the options ("Free gift wrap on every order") and the store name at the bottom.

The dates are plain text the user types. The template shouldn't work out "3 days left" or anything else from today's date, since a render has to give the same image every time.

Template details

  • File: src/templates/ecommerce/shipping-cutoff.ts, id ecommerce-shipping-cutoff
  • Fields: commonFields.title, month (text, "DEC"), day (text, "18"), method1 to method3 and cutoff1 to cutoff3 (text, optional, defaults above), note (text, optional), commonFields.siteName, commonFields.bgColor, commonFields.accentColor, commonFields.textColor

Where to look

  • Closest references: src/templates/event/countdown.ts (the month and day block), src/templates/ecommerce/coupon-code.ts (a store promo with an optional expiry line)

Acceptance criteria

  • An option with a blank cutoff is skipped with no gap, an option with a cutoff but no method shows the cutoff on its own, and with no options at all the heading and note sit centered next to the date block
  • A long heading shrinks with autoFontSize() and then truncates, a long method or cutoff truncates on its line, and a three-letter month and a two-digit day always fit inside the date block
  • The date block, options and note read fine on a light background
  • Re-exported in src/templates/ecommerce/index.ts and registered in the E-commerce block of src/templates/registry.ts
  • Meets the shared template checklist in #5

One template per contributor at a time, so more people get a chance.


Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #451 in the description.

主要語言
TypeScript
星號
8
分支
4
平均合併
1 天 21 小時
30 天內合併 PR
34

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

codercops/ogcops 的其他 Issue

查看 codercops/ogcops 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。