Module: Spree::Stores::Socials

Extended by:
ActiveSupport::Concern
Included in:
Spree::Store
Defined in:
app/models/concerns/spree/stores/socials.rb

Constant Summary collapse

SUPPORTED_SOCIAL_NETWORKS =
%w[instagram facebook twitter pinterest tiktok youtube spotify discord].freeze
SOCIAL_NETWORKS_CONFIG =
{
  twitter: {
    input_placeholder: 'https://twitter.com/your_handle',
    profile_link: 'https://twitter.com/your_handle'
  },
  instagram: {
    input_placeholder: 'https://www.instagram.com/your_handle',
    profile_link: 'https://www.instagram.com/your_handle'
  },
  facebook: {
    input_placeholder: 'https://www.facebook.com/your_page',
    profile_link: 'https://www.facebook.com/your_page'
  },
  youtube: {
    input_placeholder: 'https://www.youtube.com/@your_channel',
    profile_link: 'https://www.youtube.com/@your_channel'
  },
  pinterest: {
    input_placeholder: 'https://pinterest.com/your_handle',
    profile_link: 'https://pinterest.com/your_handle'
  },
  tiktok: {
    input_placeholder: 'your_handle',
    profile_link: 'https://www.tiktok.com/@your_handle'
  },
  spotify: {
    input_placeholder: 'https://open.spotify.com/user/your_handle',
    profile_link: 'https://open.spotify.com/user/your_handle'
  },
  discord: {
    input_placeholder: 'https://discord.com/invite/your_handle',
    profile_link: 'https://discord.com/invite/your_handle'
  }
}.freeze

Instance Method Summary collapse

Instance Method Details

#social_handleObject



63
64
65
# File 'app/models/concerns/spree/stores/socials.rb', line 63

def social_handle
  @social_handle ||= instagram_handle || youtube_handle || tiktok_handle
end


67
68
69
# File 'app/models/concerns/spree/stores/socials.rb', line 67

def social_links
  @social_links ||= [instagram_link, facebook_link, twitter_link, pinterest_link, youtube_link, tiktok_link, spotify_link, discord_link].compact_blank
end