@loafmarkets/ui 0.1.59 → 0.1.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -958,8 +958,10 @@ type PropertyBuyProps = {
958
958
  onCancelOrder?: (orderId: number) => Promise<void>;
959
959
  cancellingOrderId?: number | null;
960
960
  };
961
+ newsItems?: PropertyNewsItem[];
962
+ newsConnectionStatus?: 'live' | 'connecting';
961
963
  };
962
- declare function PropertyBuy({ propertyName, propertyLocation: propertyLocationLabel, tokenDisplayName, tokenSymbol, tokenName, isAuthenticated, onSignIn, saleData, walletUsdcBalance, walletPropertyTokenBalance, onPurchase, purchaseStatus, purchaseError, onDeposit, opensAt, isPrivateClient, recentOrders, ordersAllocated, subscribers, isLoadingActivity, selectorItems, onSelectorSelect, portfolioActivity, }: PropertyBuyProps): react_jsx_runtime.JSX.Element;
964
+ declare function PropertyBuy({ propertyName, propertyLocation: propertyLocationLabel, tokenDisplayName, tokenSymbol, tokenName, isAuthenticated, onSignIn, saleData, walletUsdcBalance, walletPropertyTokenBalance, onPurchase, purchaseStatus, purchaseError, onDeposit, opensAt, isPrivateClient, recentOrders, ordersAllocated, subscribers, isLoadingActivity, selectorItems, onSelectorSelect, portfolioActivity, newsItems, newsConnectionStatus, }: PropertyBuyProps): react_jsx_runtime.JSX.Element;
963
965
 
964
966
  type OfferingProgressCardProps = {
965
967
  ipoStarted: boolean;
package/dist/index.d.ts CHANGED
@@ -958,8 +958,10 @@ type PropertyBuyProps = {
958
958
  onCancelOrder?: (orderId: number) => Promise<void>;
959
959
  cancellingOrderId?: number | null;
960
960
  };
961
+ newsItems?: PropertyNewsItem[];
962
+ newsConnectionStatus?: 'live' | 'connecting';
961
963
  };
962
- declare function PropertyBuy({ propertyName, propertyLocation: propertyLocationLabel, tokenDisplayName, tokenSymbol, tokenName, isAuthenticated, onSignIn, saleData, walletUsdcBalance, walletPropertyTokenBalance, onPurchase, purchaseStatus, purchaseError, onDeposit, opensAt, isPrivateClient, recentOrders, ordersAllocated, subscribers, isLoadingActivity, selectorItems, onSelectorSelect, portfolioActivity, }: PropertyBuyProps): react_jsx_runtime.JSX.Element;
964
+ declare function PropertyBuy({ propertyName, propertyLocation: propertyLocationLabel, tokenDisplayName, tokenSymbol, tokenName, isAuthenticated, onSignIn, saleData, walletUsdcBalance, walletPropertyTokenBalance, onPurchase, purchaseStatus, purchaseError, onDeposit, opensAt, isPrivateClient, recentOrders, ordersAllocated, subscribers, isLoadingActivity, selectorItems, onSelectorSelect, portfolioActivity, newsItems, newsConnectionStatus, }: PropertyBuyProps): react_jsx_runtime.JSX.Element;
963
965
 
964
966
  type OfferingProgressCardProps = {
965
967
  ipoStarted: boolean;
package/dist/index.js CHANGED
@@ -12117,31 +12117,16 @@ var CancelConfirmProceed = styled25__default.default.button`
12117
12117
  cursor: not-allowed;
12118
12118
  }
12119
12119
  `;
12120
- function NewsOrdersSection({ newsItems, activityData }) {
12120
+ function NewsOrdersSection({ newsItems, newsConnectionStatus, activityData }) {
12121
12121
  return /* @__PURE__ */ jsxRuntime.jsxs(Row2, { children: [
12122
- /* @__PURE__ */ jsxRuntime.jsxs(TradeNewsPanel, { children: [
12123
- /* @__PURE__ */ jsxRuntime.jsxs(TradeNewsHeader, { children: [
12124
- /* @__PURE__ */ jsxRuntime.jsx("h3", { children: "Property News & Headlines" }),
12125
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
12126
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "dot" }),
12127
- " LIVE"
12128
- ] })
12129
- ] }),
12130
- /* @__PURE__ */ jsxRuntime.jsx(TradeNewsList, { children: newsItems.map((newsItem) => /* @__PURE__ */ jsxRuntime.jsxs(
12131
- TradeNewsItem,
12132
- {
12133
- "data-new": newsItem.isNew,
12134
- children: [
12135
- /* @__PURE__ */ jsxRuntime.jsx(TradeNewsTitle, { children: newsItem.title }),
12136
- /* @__PURE__ */ jsxRuntime.jsxs(TradeNewsInfo, { children: [
12137
- /* @__PURE__ */ jsxRuntime.jsx(TradeNewsDate, { "data-new": newsItem.isNew, children: newsItem.date }),
12138
- /* @__PURE__ */ jsxRuntime.jsx(TradeNewsCategory, { "data-type": newsItem.type, children: newsItem.type === "property" ? "Property Update" : "Market News" })
12139
- ] })
12140
- ]
12141
- },
12142
- newsItem.displayId || `${newsItem.id}-fallback`
12143
- )) })
12144
- ] }),
12122
+ /* @__PURE__ */ jsxRuntime.jsx(
12123
+ PropertyNewsUpdates,
12124
+ {
12125
+ items: newsItems,
12126
+ heading: "Property News & Updates",
12127
+ connectionStatus: newsConnectionStatus
12128
+ }
12129
+ ),
12145
12130
  /* @__PURE__ */ jsxRuntime.jsx(ActivityWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
12146
12131
  PortfolioActivityPanel,
12147
12132
  {
@@ -12179,7 +12164,7 @@ var Row2 = styled25__default.default.div`
12179
12164
  overflow: hidden;
12180
12165
  }
12181
12166
  `;
12182
- var TradeNewsPanel = styled25__default.default.div`
12167
+ var ActivityWrapper = styled25__default.default.div`
12183
12168
  background-color: var(--color-card-darker, #111);
12184
12169
  border-radius: 8px;
12185
12170
  padding: 1.5rem;
@@ -12189,107 +12174,11 @@ var TradeNewsPanel = styled25__default.default.div`
12189
12174
  border: 1px solid var(--color-border);
12190
12175
  min-height: 280px;
12191
12176
  overflow: hidden;
12192
- @media (max-width: 768px) {
12193
- max-width: 100%;
12194
- flex: 0 0 100%;
12195
- }
12196
12177
  @media (max-width: 768px) {
12197
12178
  padding: 1rem;
12198
12179
  min-height: auto;
12199
12180
  }
12200
12181
  `;
12201
- var ActivityWrapper = styled25__default.default(TradeNewsPanel)``;
12202
- var TradeNewsHeader = styled25__default.default.div`
12203
- display: flex;
12204
- justify-content: space-between;
12205
- align-items: center;
12206
- padding-bottom: 0.75rem;
12207
- margin-bottom: 1rem;
12208
- border-bottom: 1px solid rgba(255,255,255,0.1);
12209
- h3 {
12210
- margin: 0;
12211
- font-size: 0.9rem;
12212
- font-weight: 600;
12213
- color: var(--color-text);
12214
- }
12215
- span {
12216
- font-size: 0.7rem;
12217
- color: var(--color-text-secondary);
12218
- display: flex;
12219
- align-items: center;
12220
- gap: 0.25rem;
12221
- font-weight: 500;
12222
- }
12223
- .dot {
12224
- width: 6px;
12225
- height: 6px;
12226
- border-radius: 50%;
12227
- background-color: #0ecb81;
12228
- animation: pulse 2s infinite;
12229
- }
12230
- @keyframes pulse {
12231
- 0% { opacity: 0.4; }
12232
- 50% { opacity: 1; }
12233
- 100% { opacity: 0.4; }
12234
- }
12235
- `;
12236
- var TradeNewsList = styled25__default.default.div`
12237
- display: flex;
12238
- flex-direction: column;
12239
- gap: 0.75rem;
12240
- flex: 1;
12241
- overflow: visible;
12242
- max-width: 100%;
12243
- `;
12244
- var TradeNewsItem = styled25__default.default.div`
12245
- display: flex;
12246
- flex-direction: column;
12247
- padding: 0.75rem;
12248
- background-color: rgba(255,255,255,0.05);
12249
- border-radius: 6px;
12250
- cursor: pointer;
12251
- transition: all 0.2s;
12252
- &[data-new='true'] {
12253
- background-color: rgba(14,203,129,0.1);
12254
- }
12255
- &:hover {
12256
- background-color: rgba(255,255,255,0.08);
12257
- transform: translateY(-2px);
12258
- }
12259
- `;
12260
- var TradeNewsTitle = styled25__default.default.h4`
12261
- font-size: 0.9375rem;
12262
- font-weight: 500;
12263
- margin: 0 0 0.5rem 0;
12264
- color: var(--color-text);
12265
- `;
12266
- var TradeNewsInfo = styled25__default.default.div`
12267
- display: flex;
12268
- justify-content: space-between;
12269
- align-items: center;
12270
- font-size: 0.75rem;
12271
- color: var(--color-text-secondary);
12272
- `;
12273
- var TradeNewsDate = styled25__default.default.span`
12274
- &[data-new='true'] {
12275
- color: #0ecb81;
12276
- }
12277
- `;
12278
- var TradeNewsCategory = styled25__default.default.span`
12279
- padding: 0.25rem 0.5rem;
12280
- border-radius: 4px;
12281
- background-color: rgba(240,185,11,0.1);
12282
- color: var(--color-accent, #f0b90b);
12283
- font-weight: 500;
12284
- white-space: nowrap;
12285
- overflow: hidden;
12286
- text-overflow: ellipsis;
12287
- max-width: 100px;
12288
- &[data-type='property'] {
12289
- background-color: rgba(14,203,129,0.1);
12290
- color: #0ecb81;
12291
- }
12292
- `;
12293
12182
  function OrderConfirmationModal({
12294
12183
  open,
12295
12184
  onClose,
@@ -12544,22 +12433,6 @@ var ButtonRow2 = styled25__default.default.div`
12544
12433
  `;
12545
12434
 
12546
12435
  // src/components/property-buy/constants.ts
12547
- var allNewsItems = [
12548
- { id: 1, title: "RBA signals potential rate cut in Q1 2026 - property stocks rally", type: "market" },
12549
- { id: 2, title: "Sydney unemployment drops to 3.1% - Eastern suburbs lead recovery", type: "market" },
12550
- { id: 3, title: "Musgrave heritage listing confirmed - protects architectural value", type: "property" },
12551
- { id: 4, title: "Mosman Council approves DA for Musgrave restoration works", type: "property" },
12552
- { id: 5, title: "Nearby 12 Mcleod St sells for $18.5M - sets new street record", type: "market" },
12553
- { id: 6, title: "Eastern suburbs rental yields reach 3.8% - highest in 5 years", type: "market" },
12554
- { id: 7, title: "Musgrave pool resurfacing completed - heritage sandstone preserved", type: "property" },
12555
- { id: 8, title: "Mosman median house price hits $7.2M - up 9% YoY", type: "market" },
12556
- { id: 9, title: "Musgrave gardens featured in Heritage NSW annual report", type: "property" },
12557
- { id: 10, title: "Lower North Shore vacancy rates drop to 1.2% - rental demand surges", type: "market" },
12558
- { id: 11, title: "Musgrave structural inspection complete - excellent condition confirmed", type: "property" },
12559
- { id: 12, title: "Sydney harbour views premium reaches 35% - Mosman leads growth", type: "market" },
12560
- { id: 13, title: "New security system installed at Musgrave - smart home integration", type: "property" },
12561
- { id: 14, title: "Heritage property demand up 22% - pre-Federation homes most sought", type: "market" }
12562
- ];
12563
12436
  var musgraveGalleryImages = [
12564
12437
  { src: "/properties/Musgrave/ExteriorFront_Musgrave_Loafmarkets.jpg", title: "Exterior Front", subtitle: "Grand entrance" },
12565
12438
  { src: "/properties/Musgrave/ExteriorDusk_Musgrave_Loafmarkets.jpg", title: "Exterior Dusk", subtitle: "Evening ambiance" },
@@ -12614,7 +12487,9 @@ function PropertyBuy({
12614
12487
  isLoadingActivity = false,
12615
12488
  selectorItems,
12616
12489
  onSelectorSelect,
12617
- portfolioActivity
12490
+ portfolioActivity,
12491
+ newsItems = [],
12492
+ newsConnectionStatus
12618
12493
  }) {
12619
12494
  const [sliderValue, setSliderValue] = React5.useState(0);
12620
12495
  const [availableBalance, setAvailableBalance] = React5.useState(walletUsdcBalance ?? 0);
@@ -12627,15 +12502,6 @@ function PropertyBuy({
12627
12502
  const [orderPlacedSuccess, setOrderPlacedSuccess] = React5.useState(false);
12628
12503
  const [lastOrderDetails, setLastOrderDetails] = React5.useState(null);
12629
12504
  const [showOrderConfirmModal, setShowOrderConfirmModal] = React5.useState(false);
12630
- const [, setLiveNewsIndex] = React5.useState(0);
12631
- const [newsItems, setNewsItems] = React5.useState(
12632
- () => allNewsItems.slice(0, 4).map((item, index) => ({
12633
- ...item,
12634
- displayId: `${item.id}-initial-${index}`,
12635
- date: index === 0 ? "Just now" : `${(index + 1) * 3} minutes ago`,
12636
- isNew: false
12637
- }))
12638
- );
12639
12505
  const tokenPrice = saleData?.tokenPrice ?? 250;
12640
12506
  const feeRate = (saleData?.feePercent ?? 0.5) / 100;
12641
12507
  const totalSold = saleData?.totalSold ?? 0;
@@ -12735,29 +12601,6 @@ function PropertyBuy({
12735
12601
  setSliderValue(0);
12736
12602
  setManualOrderAmount(null);
12737
12603
  };
12738
- React5.useEffect(() => {
12739
- const newsInterval = setInterval(() => {
12740
- setLiveNewsIndex((prev) => {
12741
- const nextIndex = (prev + 1) % allNewsItems.length;
12742
- setNewsItems((current) => {
12743
- const incoming = allNewsItems[nextIndex];
12744
- if (current.some((item) => item.id === incoming.id)) {
12745
- return current;
12746
- }
12747
- return [
12748
- { ...incoming, displayId: `${incoming.id}-${Date.now()}`, date: "Just now", isNew: true },
12749
- ...current.slice(0, 3).map((item) => ({
12750
- ...item,
12751
- isNew: false,
12752
- date: item.date === "Just now" ? "8 seconds ago" : item.date
12753
- }))
12754
- ];
12755
- });
12756
- return nextIndex;
12757
- });
12758
- }, 8e3);
12759
- return () => clearInterval(newsInterval);
12760
- }, []);
12761
12604
  if (saleData?.loading) {
12762
12605
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-16 px-8 text-[var(--color-text-secondary)] text-center text-[0.9rem]", children: "Loading sale data..." });
12763
12606
  }
@@ -12855,6 +12698,7 @@ function PropertyBuy({
12855
12698
  NewsOrdersSection,
12856
12699
  {
12857
12700
  newsItems,
12701
+ newsConnectionStatus,
12858
12702
  activityData: portfolioActivity
12859
12703
  }
12860
12704
  )